forked from jdelamater99/Twitter-RSS-Parser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
user.php
38 lines (29 loc) · 1.27 KB
/
user.php
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
<?php
//v1.1
$host = 'api.twitter.com';
$method = 'GET';
$path = '/1.1/statuses/user_timeline.json'; // api call path
$query = array( // query parameters
'screen_name' => $sn,
'count' => $cnt,
'trim_user' => $user_trim_user,
'exclude_replies' => $user_exclude_replies,
'contributor_details' => $user_contributor_details,
'include_rts' => $user_include_rts,
);
include "functions.php";
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'
|| $_SERVER['SERVER_PORT'] == 443) {
$protocol = 'https://';
} else {
$protocol = 'http://';
}
print('<?xml version="1.0" encoding="utf-8"?>'. PHP_EOL);
print('<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en" xml:base="'.$_SERVER['SERVER_NAME'].'">'. PHP_EOL);
print('<id>tag:twitter.com,2006:/'.$twitter_data[0]['user']['screen_name'].'</id>'. PHP_EOL);
print('<title>@'.$twitter_data[0]['user']['screen_name'].'</title>'. PHP_EOL);
print('<updated>'.date('c', strtotime($twitter_data[0]['created_at'])).'</updated>'. PHP_EOL);
print('<link href="https://twitter.com/'.$twitter_data[0]['user']['screen_name'].'"/>'. PHP_EOL);
print('<link href="'.$protocol.$_SERVER['SERVER_NAME'].str_replace("&", "&", $_SERVER['REQUEST_URI']).'" rel="self" type="application/atom+xml" />'. PHP_EOL);
include "feed.php";
?>