有趣吧公开的一个api介绍
显示有趣新鲜事
路径:http://www.youqubar.com/api/status_[json|xml|rss]
参数:
count(可选)-记录数,范围1-20,默认为20.
示例:http://www.youqubar.com/api/status_rss?count=10
callback(可选)-javascript函数名,使用JSON格式时可用,将JSON对象作为参数直接调用
示例:http://www.youqubar.com/api/status_rss?callback=getStatuses
现有应用举例:
“海内存知己,天涯共有趣”
地址:http://www.youqubar.com/lab/gongyouqu
通过查看网页源代码找到唯一我们写的代码:http://www.youqubar.com/javascripts/map.js
地图、地理解码均来自第三方数据及应用
调用api方式:http://www.youqubar.com/api/status_json?count=2&callback=YOUQU.callBack
返回:
YOUQU.callBack([
{'created_at':'约21小时前','id': 'Mike','text':'加入有趣吧',
'user':{'upic':'http: //www.youqubar.com/images/tool/friend.gif','uurl':'http://www.youqubar.com/user/show/364','name':'Mike',
'location':'湖北武汉','description':'','profile_image_url':'http://www.youqubar.com/ /upload//pictures//2007//8//23//224152962288_l.jpg',
'url':'http://www.youqubar.com/user/show/364', 'protected':false}},
{'created_at':'3天前','id':'小会','text':'登录有趣吧',
'user': {'upic':'http://www.youqubar.com/images/tool/friend.gif','uurl':'http://www.youqubar.com/user/show/88', 'name':'小会',
'location':'湖北襄樊','description':'','profile_image_url':'http://www.youqubar.com/ /newimages//nophoto_l.jpg',
'url':'http://www.youqubar.com/user/show/88','protected':false}}
]);
“三生万物,万物有趣”
地址:http://www.youqubar.com/lab/wanwu
调用api方式:http://www.youqubar.com/api/status_json?count=2&callback=render
原理同上
返回:
render([
{'created_at':'约21小时前','id': 'Mike','text':'加入有趣吧',
'user':{'upic':'http: //www.youqubar.com/images/tool/friend.gif','uurl':'http://www.youqubar.com/user/show/364','name':'Mike',
'location':'湖北武汉','description':'','profile_image_url':'http://www.youqubar.com/ /upload//pictures//2007//8//23//224152962288_l.jpg',
'url':'http://www.youqubar.com/user/show/364', 'protected':false}},
{'created_at':'3天前','id':'小会','text':'登录有趣吧',
'user': {'upic':'http://www.youqubar.com/images/tool/friend.gif','uurl':'http://www.youqubar.com/user/show/88', 'name':'小会',
'location':'湖北襄樊','description':'','profile_image_url':'http://www.youqubar.com/ /newimages//nophoto_l.jpg',
'url':'http://www.youqubar.com/user/show/88','protected':false}}
]);
显示有趣新鲜事
路径:http://www.youqubar.com/api/status_[json|xml|rss]
参数:
count(可选)-记录数,范围1-20,默认为20.
示例:http://www.youqubar.com/api/status_rss?count=10
callback(可选)-javascript函数名,使用JSON格式时可用,将JSON对象作为参数直接调用
示例:http://www.youqubar.com/api/status_rss?callback=getStatuses
现有应用举例:
“海内存知己,天涯共有趣”
地址:http://www.youqubar.com/lab/gongyouqu
通过查看网页源代码找到唯一我们写的代码:http://www.youqubar.com/javascripts/map.js
地图、地理解码均来自第三方数据及应用
调用api方式:http://www.youqubar.com/api/status_json?count=2&callback=YOUQU.callBack
返回:
YOUQU.callBack([
{'created_at':'约21小时前','id': 'Mike','text':'加入有趣吧',
'user':{'upic':'http: //www.youqubar.com/images/tool/friend.gif','uurl':'http://www.youqubar.com/user/show/364','name':'Mike',
'location':'湖北武汉','description':'','profile_image_url':'http://www.youqubar.com/ /upload//pictures//2007//8//23//224152962288_l.jpg',
'url':'http://www.youqubar.com/user/show/364', 'protected':false}},
{'created_at':'3天前','id':'小会','text':'登录有趣吧',
'user': {'upic':'http://www.youqubar.com/images/tool/friend.gif','uurl':'http://www.youqubar.com/user/show/88', 'name':'小会',
'location':'湖北襄樊','description':'','profile_image_url':'http://www.youqubar.com/ /newimages//nophoto_l.jpg',
'url':'http://www.youqubar.com/user/show/88','protected':false}}
]);
“三生万物,万物有趣”
地址:http://www.youqubar.com/lab/wanwu
调用api方式:http://www.youqubar.com/api/status_json?count=2&callback=render
原理同上
返回:
render([
{'created_at':'约21小时前','id': 'Mike','text':'加入有趣吧',
'user':{'upic':'http: //www.youqubar.com/images/tool/friend.gif','uurl':'http://www.youqubar.com/user/show/364','name':'Mike',
'location':'湖北武汉','description':'','profile_image_url':'http://www.youqubar.com/ /upload//pictures//2007//8//23//224152962288_l.jpg',
'url':'http://www.youqubar.com/user/show/364', 'protected':false}},
{'created_at':'3天前','id':'小会','text':'登录有趣吧',
'user': {'upic':'http://www.youqubar.com/images/tool/friend.gif','uurl':'http://www.youqubar.com/user/show/88', 'name':'小会',
'location':'湖北襄樊','description':'','profile_image_url':'http://www.youqubar.com/ /newimages//nophoto_l.jpg',
'url':'http://www.youqubar.com/user/show/88','protected':false}}
]);