Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.3k views
in Technique[技术] by (71.8m points)

how does one post a thumbnail picture to a Facebook /links object?

What works fine for posting to a /feed does not work the same for posting to /links. While no error is generated, and I get an ID back indicating success, the thumbnail I specified as "picture=http://site/url/photo.gif" does not show up. Here is the command I used:

curl -F 
     "picture=http://tycho.usno.navy.mil/gif/moons/m146.gif" 
     -F "message=How I look tonight to my worshippers on Earth" 
     -F "name=Current Moon Phase" 
     -F "link=http://www.calculatorcat.com/moon_phases/phasenow.php" -F caption="How the Moon appears tonight" 
     -F "access_token=111111111111111|2222222222222222222222222|33333333333333333333456n" 
     "https://graph.facebook.com/215958041750734/links"

Now, the same data, but published to The Moon's wall (feed), works as expected:

curl -F 
     "picture=http://tycho.usno.navy.mil/gif/moons/m146.gif" 
     -F "message=you're looking great tonight!" 
     -F "name=Current Moon Phase" 
     -F "link=http://www.calculatorcat.com/moon_phases/phasenow.php" -F caption="How the moon appears tonight" 
     -F "access_token=111111111111111|2222222222222222222222222|33333333333333333333456n" 
     "https://graph.facebook.com/215958041750734/feed"

The results of both can be seen in the June 13 posts on the Facebook "The Moon" page: https://www.facebook.com/pages/The-Moon/215958041750734

Any way to get the thumbnail picture to show up on The Moon's own post to /links?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

From experimentation, it turns out that the "picture=" option, if present, is ignored. It pulls a thumbnail from the page itself, if any images happen to be on it; otherwise no thumbnail can be displayed. As a workaround, one could embed the desired content on a server under his own control, in a frameset or iframe, and embed the desired thumbnail in that page, posting that link to the desired facebook id's /links object.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...