Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ニコニコのコメントAPIに関する覚え書き
- ===============================
- ニコニコ動画のコメントAPIに与えるパラメータの作りについての覚え書き。
- パラメータとして投げるのはJSON。sm\~とso\~,{0-9}+とでそれぞれ形式が異なる。
- ## sm~
- idが**sm~**で始まる動画はユーザ動画。パラメータは最もシンプル:
- [
- {
- "ping": {
- "content": "rs:0"
- }
- },
- {
- "ping": {
- "content": "ps:0"
- }
- },
- {
- "thread": {
- "thread": [threadの値],
- "version": "20090904",
- "fork": 0,
- "language": 0,
- "user_id": [user_idの値],
- "with_global": 1,
- "scores": 1,
- "nicoru": 0,
- "userkey": [userkeyの値]
- }
- },
- {
- "ping": {
- "content": "pf:0"
- }
- },
- {
- "ping": {
- "content": "ps:1"
- }
- },
- {
- "thread_leaves": {
- "thread": [threadの値],
- "language": 0,
- "user_id": [user_idの値],
- "content": "0-27:100,1000", //0-[動画時間分(切り上げ):[最低コメント数],[最大コメント数]] かな? よぐわがんね
- "scores": 1,
- "nicoru": 0,
- "userkey": [userkeyの値]
- }
- },
- {
- "ping": {
- "content": "pf:1"
- }
- },
- {
- "ping": {
- "content": "rf:0"
- }
- }
- ]
- ## so\~,{0-9}+
- idが**so\~**から始まる、あるいは**数字のみ**の動画は企業などの配信動画。パラメータが若干増える:
- [
- {
- "ping": {
- "content": "rs:0"
- }
- },
- {
- "ping": {
- "content": "ps:0"
- }
- },
- {
- "thread": {
- "thread": [threadの値],
- "version": "20090904",
- "fork": 0,
- "language": 0,
- "user_id": [user_idの値],
- "with_global": 1,
- "scores": 1,
- "nicoru": 0,
- "userkey": [userkeyの値]
- }
- },
- {
- "ping": {
- "content": "pf:0"
- }
- },
- {
- "ping": {
- "content": "ps:1"
- }
- },
- {
- "thread_leaves": {
- "thread": [threadの値],
- "language": 0,
- "user_id": [user_idの値],
- "content": "0-24:100,1000", ////0-[動画時間分(切り上げ):[最低コメント数],[最大コメント数]] と思われる
- "scores": 1,
- "nicoru": 0,
- "userkey": [userkeyの値]
- }
- },
- {
- "ping": {
- "content": "pf:1"
- }
- },
- {
- "ping": {
- "content": "ps:2"
- }
- },
- {
- "thread": {
- "thread": [threadの値],
- "version": "20090904",
- "fork": 0,
- "language": 0,
- "user_id": [user_idの値],
- "force_184": "1",
- "with_global": 1,
- "scores": 1,
- "nicoru": 0,
- "threadkey": [threadkeyの値]
- }
- },
- {
- "ping": {
- "content": "pf:2"
- }
- },
- {
- "ping": {
- "content": "ps:3"
- }
- },
- {
- "thread_leaves": {
- "thread": [threadの値],
- "language": 0,
- "user_id": [user_idの値],
- "content": "0-24:100,1000", //上記コメント参照のこと
- "scores": 1,
- "nicoru": 0,
- "force_184": "1",
- "threadkey": [threadkeyの値]
- }
- },
- {
- "ping": {
- "content": "pf:3"
- }
- },
- {
- "ping": {
- "content": "rf:0"
- }
- }
- ]
- ## 見返してみて
- どうにもこのjsonのパラメータ、サーバ側でxmlに変換してるんでなかろうか、という印象を受けた。
- 冗長な記述が多く、なんでこんな作りにしたのか、前々分からん!
Add Comment
Please, Sign In to add comment