首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >谁能给我提供一些集成FriendFeed API的信息?

谁能给我提供一些集成FriendFeed API的信息?
EN

Stack Overflow用户
提问于 2011-06-27 19:47:10
回答 1查看 90关注 0票数 0

通过FriendFeed集成PHP,我怎样才能做到这一点。我正在开发一个网站,在那里我想集成FriendFeed..

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-06-27 19:50:45

查看此示例代码

代码语言:javascript
运行
复制
include("friendfeed.php");
include("JSON.php");

//Connect
$friendfeed = new FriendFeed("yourusername", "yourpassword");

//Sample code to post data via the API
$entry = $friendfeed->publish_message("Testing the FriendFeed API");

//Sample PHP code to get data for a specific users feed via the FriendFeed API
//The below gets the first 30 entries in that users feed

$feed = $friendfeed->fetch_user_feed("some_random_user_name", 0, 0, 30);
foreach ($feed->entries as $entry) {
 //get the image of the service, and its name (eg twitter, googlereader...)
 $output .= '<img src="' . $entry->service->iconUrl . '" alt="'. 
 $entry->service->name . '" />';

 //get the title of the entry and link to it
 $output .= $entry->service->name.'<a href="'.$entry->link.'">'.
 $entry->title.'</a>';

 //get the date of the entry
 $output .= date('Y m d', $entry->published);

}

 echo $output; //prints the entry title, icon and link to the entry

Here是进一步参考的来源。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6492355

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档