由于自己的博客流量還是有限的闪幽,這個(gè)時(shí)候覺(jué)得如果自己的文章能夠同步到其他社區(qū)增加搜索引擎的覆蓋率肯定是好的,但是如果需要手動(dòng)的去填寫(xiě) 就會(huì)比較麻煩涡匀。
這個(gè)時(shí)候 一個(gè)自動(dòng)同步文章的功能就很必要了盯腌。
首先我打開(kāi)簡(jiǎn)書(shū),觀察了一下寫(xiě)作部分幾個(gè)重要的接口
"http://www.reibang.com/author/notes" // 新增文章
// 請(qǐng)求: POST:Payload
{
at_bottom: true,
notebook_id: "123456",
title: "2019-08-26"
}
// 返回:
{
"id":12345678,
"title":"",
"slug":"cb5cd5cf2d87",
"shared":false,
"notebook_id":123456,
"seq_in_nb":4,
"note_type":2,
"autosave_control":0,
"content_updated_at":1566784284,
"last_compiled_at":0
}
"http://www.reibang.com/author/notes/id" // 更新/保存文章
// 請(qǐng)求: PUT:Payload
{
autosave_control: 3,
content: "",
id: "12345678",
title: ""
}
// 返回
{
id: 53149573,
content_updated_at: 1566784581,
content_size_status: "fine",
last_compiled_at: 0
}
"http://www.reibang.com/author/notes/id/publicize" //發(fā)布內(nèi)容
// 請(qǐng)求 POST
// 返回
{
last_compiled_at: 1566785008
}
每一次請(qǐng)求都會(huì)帶上cookie
cookie: '__yadk_uid=FmCf6d7ag3P3S...; read_mode=day; default_font=font2; locale=zh-CN; Hm_lvt_0c0e9d9b1e7d617b3e6842e85b9fb068=1565856638,1566192735,1566198534,1566200375; remember_user_token=W1s4NzYwOTA1XSwiJDJhJDExJEU3OGFOcGtDa3dXZmNGNGRiRXZ3VmUiLCIxNTY2Nzg0Mj...; _m7e_session_core=92349b02308ed3e77c15f27efbc59e3c; Hm_lpvt_0c0e9d9b1e7d617b3e6842e85b9fb068=1566785365; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2216a495dbbcb95e-0bf31b3d2425b5-366e7e04-1296000-16a495dbbcc58d%22%2C%22%24device_id%22%3A%2216a495dbbcb95e-0bf31b3d2425b5-366e7e04-1296000-16a495dbbcc58d%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%2C%22first_id%22%3A%22%22%7D'
這里面有用的只有 __yadk_uid, remember_user_token
兩個(gè)用來(lái)后臺(tái)識(shí)別用戶的