forked from jdelamater99/Twitter-RSS-Parser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.php-dist
176 lines (117 loc) · 7.62 KB
/
config.php-dist
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
//v1.1
// fivestone: add password check, without "&pw=xxxx" behind the url you will get nothing
$fs_password='xxxx';
if ( $fs_password != $_GET["pw"] )
{ exit;
}
// fivestone: add white list check, only user in the list can use the screen_name function
$fs_user_whitelist = array('fivestone','others');
if ( isset( $_GET["screen_name"] )
&& !in_array($_GET["screen_name"], $fs_user_whitelist))
{ exit;
}
// fivestone: add option to filter screen_name in RSS title and content
$fs_is_showID = true;
if ( isset( $_GET["screen_name"] ) )
{ $fs_is_showID = false;
}
$token = 'XXXX';
$token_secret = 'XXXX';
$consumer_key = 'XXXX';
$consumer_secret = 'XXXX';
/* The screen name of the user for whom to return results for. Default screen_name if one isn't specified in the URL */
$twit_name = "XXXX";
$count = 5;
/////////////////////////////////////////////////////////////////
// User Status Parameters
/* Specifies the number of tweets to try and retrieve, up to a maximum of 200 per distinct request. The value of count is best thought of as a limit to the number of tweets to return because suspended or deleted content is removed after the count has been applied. We include retweets in the count, even if include_rts is not supplied. It is recommended you always send include_rts=1 when using this API method. */
$user_count = '5';
/* When set to false, the timeline will strip any native retweets (though they will still count toward both the maximal length of the timeline and the slice selected by the count parameter). Note: If you're using the trim_user parameter in conjunction with include_rts, the retweets will still contain a full user object. */
$user_include_rts = false;
/* When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object. */
$user_trim_user = false;
/* This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets — this is because the count parameter retrieves that many tweets before filtering out retweets and replies. */
$user_exclude_replies = true;
/* This parameter enhances the contributors element of the status response to include the screen_name of the contributor. By default only the user_id of the contributor is included. */
$user_contributor_details = false;
/////////////////////////////////////////////////////////////////
// List Parameters
/* Specifies the number of tweets to try and retrieve, up to a maximum of 200 per distinct request. The value of count is best thought of as a limit to the number of tweets to return because suspended or deleted content is removed after the count has been applied. We include retweets in the count, even if include_rts is not supplied. It is recommended you always send include_rts=1 when using this API method. */
$list_count = '15';
/* When set to false, the timeline will strip any native retweets (though they will still count toward both the maximal length of the timeline and the slice selected by the count parameter). Note: If you're using the trim_user parameter in conjunction with include_rts, the retweets will still contain a full user object. */
$list_include_rts = false;
/* When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object. */
$list_trim_user = false;
/* When set to either true, t or 1, each tweet will include a node called "entities". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more details. */
$list_include_entities = true;
/////////////////////////////////////////////////////////////////
// Home Timeline Parameters
/* Specifies the number of tweets to try and retrieve, up to a maximum of 200 per distinct request. The value of count is best thought of as a limit to the number of tweets to return because suspended or deleted content is removed after the count has been applied. We include retweets in the count, even if include_rts is not supplied. It is recommended you always send include_rts=1 when using this API method. */
$home_count = '100';
/* When set to false, the timeline will strip any native retweets (though they will still count toward both the maximal length of the timeline and the slice selected by the count parameter). Note: If you're using the trim_user parameter in conjunction with include_rts, the retweets will still contain a full user object. */
$home_include_rts = true;
/* When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object. */
$home_trim_user = false;
/* When set to either true, t or 1, each tweet will include a node called "entities". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more details. */
$home_include_entities = true;
/* This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets — this is because the count parameter retrieves that many tweets before filtering out retweets and replies. */
$home_exclude_replies = false;
/* This parameter enhances the contributors element of the status response to include the screen_name of the contributor. By default only the user_id of the contributor is included. */
$home_contributor_details = false;
/////////////////////////////////////////////////////////////////
// Search Parameters
/* Optional. Specifies what type of search results you would prefer to receive. The current default is "mixed." */
/* mixed|recent|popular */
$search_result_type = 'mixed';
/* When set to either true, t or 1, each tweet will include a node called "entities". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more details. */
$search_include_entities = true;
/////////////////////////////////////////////////////////////////
// establish defaults for required parameters
//////////
// User
if (!isset( $_GET["screen_name"] )) {
$screen_name = $twit_name;
} else {
$screen_name = $_GET["screen_name"];
$count = $user_count;
}
//////////
// List
if (!isset( $_GET["list"] )) {
$list = NULL;
} else {
$list = $_GET["list"];
$count = $list_count;
}
if (!isset( $_GET["owner"] ))
$_GET["owner"] = $twit_name;
$owner = $_GET["owner"];
//////////
// Home
if (!isset( $_GET["home"] )) {
$home = false;
$q = NULL;
} else {
$home = true;
$count = $home_count;
}
//////////
// Search
if (!isset( $_GET["q"] )) {
$search = false;
$q = NULL;
} else {
$search = true;
$q = $_GET["q"];
}
if (isset( $_GET["count"] ))
$count = intval( $_GET["count"] );
/////////////////////////////////////////////////////////////////
// sanitize variables remote user variables
$cnt = htmlspecialchars($count);
$sn = htmlspecialchars($screen_name);
$list = htmlspecialchars($list);
$owner = htmlspecialchars($owner);
//$q = htmlspecialchars($q);
?>