forked from simonprickett/localtweets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtwitter.class.php
38 lines (30 loc) · 1022 Bytes
/
twitter.class.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
class Twitter
{
public function __construct(){ }
public function searchQuery( $search = null)
{
$url = "http://search.twitter.com/search.rss?q=" . urlencode( $search ) . "&lang=en&rpp=50";
$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, $url );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
$result = curl_exec( $curl );
curl_close( $curl );
$return = new SimpleXMLElement( $result );
return $return;
$return = new SimpleXMLElement( $result );
}
public function searchGeo( $search = null)
{
$url = "http://search.twitter.com/search.rss?geocode=" . $search;
$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, $url );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
$result = curl_exec( $curl );
curl_close( $curl );
$return = new SimpleXMLElement( $result );
return $return;
$return = new SimpleXMLElement( $result );
}
}
?>