[WordPress] 外掛分享: photostream-sync

首頁外掛目錄 › photostream-sync
30+
安裝啟用
★★★☆☆
3.8/5 分(5 則評價)
4340 天前
最後更新
問題解決
WordPress 3.8+ v2.1.2 上架:2013-01-26

內容簡介

假設你有類似 iPhone 的裝置,並用它拍照,你肯定希望有個簡單的方式可以自動地建立 WordPress 網誌做為一個相簿。現在你可以透過這個外掛來實現。iCloud 中的 Photo Stream 功能專門為這種任務而設,它可以同步到 iPhoto 應用程式,也可以與你的朋友和電視分享照片。透過這個外掛,你可以讓你的 WordPress 網誌自動發現你的 iOS 裝置共享的新照片並匯入。

只需要設定一個 Photo Stream,並將其配置為具有「公開網站」選項,這個外掛將會為你處理其餘的事宜。

一次共享多張照片?這個外掛會自動建立一個包含你共享所有圖片的相簿文章。
在共享照片時,你也可以附加評論。這個外掛將自動將你的文字添加到相簿文章中。
不想讓隨便誰都能看到你的圖片?你可以保護你的文章。
想要在文章發佈前先編輯、重新命名和審查?這個外掛可以讓文章先進入草稿狀態,等待你進行調整。
你是主題或外掛開發人員嗎?你可以利用圖片中的自定義文章類型、標籤、分類和自動建立的 EXIF 元數據建立令人驚奇的相簿。
不想手動點擊添加照片?這個外掛會利用 WordPress 計畫的工作功能逐步匯入照片,不需要你的幫助。

關於 iCloud 的運作方式

警告:這部分比較深奧。

iCloud 提供了一個 JSON API 端點來管理 Photo Streams。這個端點有照片的列表(但是沒有照片的 URL),以及一些相關的數據(例如,屬於哪個組、誰發佈的等等)。這些數據足以讓你發送 HTTP POST 請求到另一個 URL 上,獲取足夠的信息以建立圖片的 URL。這個數據只有短期內有效(用此建立的 URL 會過期),因此必要時需要重新獲取。這也是為什麼不能只導入圖片的 URL 列表就結束了。最後,你可以向每個圖片發送一個 HTTP 請求以獲取數據。

實際上,這個外掛所做的就是當你訪問公開 Photostream 鏈接時,自動執行你的網頁瀏覽器操作。

我還沒有深入研究照片按讚和附加評論的儲存方式。

針對主題開發人員

對於主題開發人員而言,沒有太多要注意的事項。你可以指定相簿的類別或標籤,也可以指定自定義文章類型。因此你非常靈活。最後,如果安裝且啟用了 PHP 的 Exif 擴展程序(http://www.php.net/exif),則這個外掛會將找到的所有 EXIF 元數據作為圖像附件的貼文元數據進行存儲。例如:

ps_exif_Make => Apple
ps_exif_Model => iPhone 4S
ps_exif_XResolution => 72/1
ps_exif_YResolution => 72/1
ps_exif_ResolutionUnit => 2

待辦清單

記錄(通過自定義文章類型實現),可能還需要錯誤報告和處理(也可能通過自定義文章類型)
在相簿頁面上添加歷史 / 帖子 / 圖像列表(實際上是活動日誌)
為 dev mode 添加反饋流程的按鈕
將某些 dev 模式實現為人們可以執行的操作(例如強制處理相簿)
將圖片標題 / 註釋 / 內容添加到帖子的相冊中(當你加入照片時)

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.1.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「photostream-sync」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Lets say, for the sake of argument that you have something like an iPhone. And you use it to take pictures. You sure wish there was an easy way to be able to set up a WordPress blog as a photoblog automatically. Now you can. The Photo Stream iCloud feature is just for this kind of task. You can sync to your iPhoto app, you can share to your friends, and even your TV. Now with this plugin you can have your WordPress blog automatically discover new photos shared from your iOS device and import them.
Just set up a Photo Stream. Configure it so that it has a “Public Web Site”. And this plugin will take care of the rest for you.

Shared a group of photos all at once? This plugin automatically makes a gallery post containing all the photos you shared together.
Did you add a comment to your shared photos? This plugin will automatcially add your text to the gallery post.
Don’t like the idea of just anybody seeing your pictures? You can Password protect your posts
Do you want to edit, rename, and curate your posts before they go live? You can have the plugin just make draft posts waiting for you to jazz them up
Are you a theme or plugin developer? Use custom post types, tags, categories, and automatically indexed EXIF metadata from the photos to make an amazing photoblog.
Don’t want to sit there clicking buttons to make photos show up? This plugin uses WordPress scheduled work functionality to gradually import photos without needing your help.

How this works in relation to iCloud
Warning: This section is pretty hardcore
iCloud publishes a JSON endpoint for its Photo Streams. This endpoint has a list of photos (but not urls for the photos) and data about them (like what group they belong to, who posted them, etc.) That endpoint gives you enough information to make an HTTP POST request to another URL at which you can find enough information to build the image fetch URLS. The data is only good for a limited amount of time (the urls that you build with this expire) and so it is necessary that you build this fresh when you’re going to use it. This is also why you can’t just import a list of photo urls and call it a day. Finally you can make a final HTTP request per image to get the data.
Essentially this plugin just does what your web browser would do if you visited the public photostream link.
I have not looked further into how likes, and additional comments on photos are stored. The data must be in there.
For theme developers
For theme developers there’s not much to know. You can specify any cats, or tags, you desire for a photostream. You can also specify custom post types. So you have a lot of flexibility. Finally, if the PHP Exif extension is installed and active ( http://www.php.net/exif ), then the plugin stores all EXIF metadata that if finds as postmeta data for the image attachment itself. For example:

ps_exif_Make => Apple
ps_exif_Model => iPhone 4S
ps_exif_XResolution => 72/1
ps_exif_YResolution => 72/1
ps_exif_ResolutionUnit => 2

To Do List

Logging (via custom post type, I think)
Error reporting, and handling (probably also via custom post type)
Add history/post/image listing to stream pages (essentially an activity log)
Add feedback for “dev mode” process now clicks
Make some of the dev mode things just things people can do (force-process stream, for example)
Add images captions/notes/whatever to gallery posts as text (when you push a group of photos to a stream you can supply text)
See about importing comments as comments on the gallery with reference to the specific image (people can comment and like your photos)
Work within PHPs time limits (Fatal error, time limit of %d seconds exceeded)
uninstaller
Add cats from the add/manage section of the admin UI

延伸相關外掛

文章
Filter
Apply Filters
Mastodon