9. upload.sh
再來是 Facebook 的 commandline
https://apps.facebook.com/cmdline/
請照他的指示去做
Step 0: install fbcmd
Step 1: grant basic access:
[fbcmd go access]
Step 2: generate AUTH code:
[fbcmd go auth]
10. Step 3: enter auth code:
[fbcmdauth XXXXX]
Step 4: grant extended permissions:
[fbcmdaddperm]
Step 5: test your installation:
[fbcmd test]
Step 6: have fun
安裝後記得回你的 facebook 點確認這個程式對你的個人資料做存取。
接下來他上面有 wiki 裡面有更詳盡的解釋,我只取我們有用到的部分。
POST
描述:
分享故事,圖片,MP3 或是 Flash 動畫到你的塗鴉牆
Parameters
POST
1 (必填)
Text
Post Message. 輸入像是狀態更新的文字。所以可以撐家動態文字
11. For example "is loving this POST command". (see below)
2 (選擇性 Text
Post Name.如果是填入 URL 的話,那麼他就會變成一個連結 (see below)
填空)
3 (選擇性 URL Post Link. 放置 URL 的連結 (see below)
填空)
4 (選擇性 Text
Post Caption. The Caption appears below the Name. (see below)
填空)
5 (選擇性 Text
Post Description. The Description appears below the Caption. (see below)
填空)
POST
POST IMG
1 (必填) Text
Post Message.
2 (必填) Image
Image Source. 你想分享的圖片的 URL。
URL
12. 3 (必填) URL
Image Link. 讓你可以造訪圖片的來源網址。
4..7
Post Name, Link, Caption, Description (see 2..5 above)
POST IMG
POST MP3
1 (必填)
Text
Post Message.
2 (必填)
MP3
Song Source. This is a URL that points to the mp3 you want to shar
URL
3 (選擇性填空) Text
Song Title.
4 (選擇性填空) Text
Song Artist.
5 (選擇性填空) Text
Song Album.
6..9
Post Name, Link, Caption, Description (see 2..5 above)
我們使用了第一個 POST 指令,但是也是不會出現縮圖。
但是我們發現下面有一個 POST IMG 的指令,使用後就可以 POST 出縮圖了。
指令為
13. fbcmd POST IMG "check out this photo!"
"http://example.com/image.jpg" "http://example.com/link.html"
也可以寫成:
fbcmd POST IMG 0 "http://example.com/image.jpg" 0
省下一堆廢話的空間。
最後就是執行我們的指令碼
~/shell/execute.sh
遇到困難
fswebcam 截圖出來是一片黑 經過詢問 陳尚瑋學長 後發現 是 Logitech C170
:
,
,
的問題,需要鍵入 –p YUYV ,設定他的 color format ,如此便能正常產出圖像