PHPでウェブプログラミングをしてみよう。
ホーム > PHP と Twitter > Twitter API > Legal(規定事項) > Twitter API legal tos Twitterのサービス利用規約 php oauth接続

Twitter API legal tos Twitterのサービス利用規約 php oauth接続

Twitter API legal/tos

API Resource
GET legal/tos
概要
 要求された形式でTwitterのサービス利用規約を返します。
この規約内容は開発者向けサービス利用規約とは異なります。
原文
Resource URL(リソースURL)
http://api.twitter.com/1/legal/tos.format
Resource Information(リソース情報)
Rate Limited(制限) Yes(あり)
Requires Authentication(認証) No(なし)
Response Formats(フォーマット) json xml
HTTP Methods(HTTPメソッド) GET
サンプルコード

GET https://api.twitter.com/1/legal/tos.json

– サンプル Click Here ! –

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta name="robots" content="index">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Twitter API legal tos Twitterのサービス利用規約</title>
</head>
<body>
 
 
 
<?php
#########################################
### 初期設定
//twitteroauth.phpをインクルードします。ファイルへのパスは環境に合わせて記述下さい。
require_once("./twitteroauth.php");
 
//Consumer keyの値をTwitterAPI開発者ページでご確認下さい。
$consumerKey = "***************";
//Consumer secretの値を格納
$consumerSecret = "***********************************";
//Access Tokenの値を格納
$accessToken = "***********************************";
//Access Token Secretの値を格納
$accessTokenSecret = "***********************************";
 
//OAuthオブジェクトを生成する
$twObj = new TwitterOAuth($consumerKey,$consumerSecret,$accessToken,$accessTokenSecret);
?>
 
 
 
<?php
#########################################
### ページ説明
?>
 
<h1>Twitter API legal tos Twitterのサービス利用規約</h1>
<!-- 説明ページurl -->
<h3><a href="http://www.tryphp.net/2012/02/10/phpapptwitter-legal_tos/">→説明はこちら</a></h3>
<hr/>
 
 
 
<?php
#########################################
### 取得したデータを展開
?>
 
<h2>取得したデータを展開</h2>
<div style="background-color:#f8f8f8;margin:20px; padding:20px; border:solid #cccccc 1px;">
 
<!-- // =========================== ここから =========================== -->
 
<?php
//API実行データ取得
$vRequest = $twObj->OAuthRequest("http://api.twitter.com/1/legal/tos.xml","GET",array());
 
//XMLデータをsimplexml_load_string関数を使用してオブジェクトに変換する
$oXml = simplexml_load_string($vRequest);
 
//オブジェクトを展開
var_dump($oXml);
?>
 
<!-- =========================== ここまで =========================== // -->
</div>
<hr/>
 
 
 
<?php
#########################################
### 取得したオブジェクトの内容
?>
 
<h2>取得したオブジェクトの内容</h2>
<pre>
<?php
var_dump($oXml);
?>
<\/pre>
<hr/>
 
 
 
</body>
</html>

– サンプル Click Here ! –


タグ(=記事関連ワード)

タグ: ,

日付

投稿日:2012年2月10日
最終更新日:2012年04月10日

関連記事

このカテゴリの他のページ

この記事へのコメント

トラックバックurl

http://www.tryphp.net/2012/02/10/phpapptwitter-legal_tos/trackback/

コメントを残す