No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
ステップ 3: データを取得する
Radian6 API による認証が終わり、トピックのリストを取得したら、トピックのデータを取得できます。
次の例は、Radian6 システムからあるトピックについて過去 24 時間のうち最近の 100 項目を取得する方法を示します。このデータの取得に使用するコールは、DataService.fetchRecentTopicPosts です。
1https://api-endpoint/data/topicdata/recent/{recentXhours}/{topics}
2/{mediatypes}/{PageIndex}/{pageSize}- recentXHours
- 24 (過去 24 時間のデータ)
- topics
- 232 (「ステップ 2: メソッドへのコールを発行する」のコールで取得したトピック ID)
- mediatypes
- 1,2,3,4 (LookupService.fetchMediaTypes で取得)
- PageIndex
- 1 (最初のページ)
- pageSize
- 100 (現在のページの全項目)
たとえば、開発エンドポイントへのコールは次のようになります。
1https://sandbox-insights.radian6.com/socialcloud/v1/data/topicdata
2/realtime/24/232/1,2,3,4/1/100このコールは、一致する投稿のリストをデフォルトの並び順である publish_date で並び替えて返します。結果セットの各項目は、<Article> タグで定義されます。
1<radian6_RiverOfNews_export>
2 <report_date>Fri Oct 30 10:22:06 ADT 2009</report_date>
3 <user_name>Jane Smith</user_name>
4 <RoN_sort_order>publishedDate</RoN_sort_order>
5 <article_count>1</article_count>
6 <article ID="1934621185">
7 <description charset="UTF-8">
8 <headline><![CDATA[ TWEET FROM: ACME]]>
9 </headline>
10 <author><![CDATA[ ACME]]>
11 </author>
12 <content><![CDATA[ The content of the Tweet]]>
13 </content>
14 </description>
15 <source><![CDATA[ TWEET FROM: ACME]]></source>
16 <host><![CDATA[ twitter.com]]></host>
17 <article_url> <![CDATA[ http://twitter.com/username/statuses/4735539663]]>
18 </article_url>
19 <media_provider>TWITTER</media_provider>
20 <media_type_id>8</media_type_id>
21 <spam_rating>TODO</spam_rating>
22 <publish_date>Oct 09, 2009 11:31 AM</publish_date>
23 <harvest_date>Oct 09, 2009 11:31 AM</harvest_date>
24 <PostDynamicsIteration>
25 <PostDynamicsDefinition>
26 <fieldId>9</fieldId>
27 <label>Following</label>
28 <value>0</value>
29 <sortOrder>1</sortOrder>
30 </PostDynamicsDefinition>
31 <PostDynamicsDefinition>
32 <fieldId>8</fieldId>
33 <label>Followers</label>
34 <value>0</value>
35 <sortOrder>2</sortOrder>
36 </PostDynamicsDefinition>
37 <PostDynamicsDefinition>
38 <fieldId>10</fieldId>
39 <label>Updates</label>
40 <value>0</value>
41 <sortOrder>3</sortOrder>
42 </PostDynamicsDefinition>
43 <PostDynamicsDefinition>
44 <fieldId>21</fieldId>
45 <label>Sentiment</label>
46 <shortLabel>S</shortLabel>
47 <sortOrder>4</sortOrder>
48 <value>15418,0</value>
49 <exceptionValue>15418,false</exceptionValue>
50 <reportValue>Neutral</reportValue>
51 <tooltip />
52 </PostDynamicsDefinition>
53 <reportFormatedData><![CDATA[ <span style="font-weight:bold; color: #FF9900; font-size: 11pt"> Following: </span>0 <span style="font-weight:bold; color: #FF9900; font-size: 11pt"> Followers:
54 </span>0 <span style="font-weight:bold; color: #FF9900; font-size: 11pt"> Updates: </span>0 <span style="font-weight:bold; color: #FF9900; font-size: 11pt"> Sentiment: </span>Neutral ]]>
55 </reportFormatedData>
56 </PostDynamicsIteration>
57 </article>
58 </radian6_RiverOfNews_export>