即刻Web API

In [1]:
from jike.constants import ENDPOINTS
In [2]:
for k, v in ENDPOINTS.items():
    if '{t}' not in v:
        print('Function: {fn}, URL: {url}\n'.format(fn=k, url=v))
Function: create_session, URL: https://app.jike.ruguoapp.com/sessions.create

Function: wait_login, URL: https://app.jike.ruguoapp.com/sessions.wait_for_login

Function: confirm_login, URL: https://app.jike.ruguoapp.com/sessions.wait_for_confirmation

Function: my_collections, URL: https://app.jike.ruguoapp.com/1.0/users/collections/list

Function: news_feed, URL: https://app.jike.ruguoapp.com/1.0/newsFeed/list

Function: news_feed_unread_count, URL: https://app.jike.ruguoapp.com//1.0/newsFeed/countUnreads

Function: following_update, URL: https://app.jike.ruguoapp.com/1.0/personalUpdate/followingUpdates

Function: user_profile, URL: https://app.jike.ruguoapp.com/1.0/users/profile

Function: user_post, URL: https://app.jike.ruguoapp.com/1.0/personalUpdate/single

Function: user_created_topic, URL: https://app.jike.ruguoapp.com/1.0/customTopics/custom/listCreated

Function: user_subscribed_topic, URL: https://app.jike.ruguoapp.com/1.0/users/topics/listSubscribed

Function: user_following, URL: https://app.jike.ruguoapp.com/1.0/userRelation/getFollowingList

Function: user_follower, URL: https://app.jike.ruguoapp.com/1.0/userRelation/getFollowerList

Function: topic_selected, URL: https://app.jike.ruguoapp.com/1.0/messages/history

Function: topic_square, URL: https://app.jike.ruguoapp.com/1.0/squarePosts/list

Function: list_comment, URL: https://app.jike.ruguoapp.com/1.0/comments/listPrimary

Function: create_post, URL: https://app.jike.ruguoapp.com/1.0/originalPosts/create

Function: delete_post, URL: https://app.jike.ruguoapp.com/1.0/originalPosts/remove

Function: extract_link, URL: https://app.jike.ruguoapp.com/1.0/readability/extract

Function: picture_uptoken, URL: https://upload.jike.ruguoapp.com/token

Function: picture_upload, URL: https://up.qbox.me/

Function: repost_it, URL: https://app.jike.ruguoapp.com/1.0/reposts/add

Function: comment_it, URL: https://app.jike.ruguoapp.com/1.0/comments/add

Function: search_topic, URL: https://app.jike.ruguoapp.com/1.0/users/topics/search

以下的API调用需要对应特定的消息类型

假设消息类型为'ORIGINAL_MESSAGE', 则对应的URL部分为'originalMessages'

In [3]:
message_type = 'originalMessages'
In [4]:
for k, v in ENDPOINTS.items():
    if '{t}' in v:
        v = v.format(t=message_type)
        print('Function: {fn}, URL: {url}\n'.format(fn=k, url=v))
Function: like_it, URL: https://app.jike.ruguoapp.com/1.0/originalMessages/like

Function: unlike_it, URL: https://app.jike.ruguoapp.com/1.0/originalMessages/unlike

Function: collect_it, URL: https://app.jike.ruguoapp.com/1.0/originalMessages/collect

Function: uncollect_it, URL: https://app.jike.ruguoapp.com/1.0/originalMessages/uncollect

各个URL具体的HTTP BODY在这里就不赘述了,感兴趣的可以在浏览器调试器里追踪查看API调用的 json payload 和 json response