arikfr / mrtweet-php

Mr.Tweet API PHP Wrapper

This URL has Read+Write access

mrtweet-php / MrTweetApiTest.php
100644 76 lines (69 sloc) 1.513 kb
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
<?
 
include_once ('MrTweetApi.php');
 
$apiKey = 'Please email api@mrtweet.com to request access to the API during this alpha period';
$api = new MrTweetApi ($apiKey);
 
var_dump($api->isUser('arikfr'));
echo "\n";
/*
Response:
object(stdClass)#2 (2) {
["status"]=>
string(7) "success"
["is_user"]=>
bool(true)
}
*/
 
var_dump($api->getProfile('arikfr'));
echo "\n";
/*
Response:
object(stdClass)#2 (2) {
["status"]=>
string(7) "success"
["profile"]=>
object(stdClass)#3 (4) {
["recommendations"]=>
int(0)
["conversation"]=>
float(0.785)
["links"]=>
float(0.13)
["frequency"]=>
float(10.8727)
}
}
*/
 
var_dump($api->getRecommendations('topify'));
echo "\n";
/*
object(stdClass)#2 (2) {
["status"]=>
string(7) "success"
["recommendations"]=>
array(4) {
[0]=>
object(stdClass)#3 (3) {
["date"]=>
string(25) "2009-05-31T00:48:36-07:00"
["text"]=>
string(59) "A great tool to enhance your "follow strategy" productivity"
["name"]=>
string(14) "carmelventures"
}
[1]=>
object(stdClass)#4 (3) {
["date"]=>
string(25) "2009-05-28T18:35:17-07:00"
["text"]=>
string(114) "@topify to get an invite for their service: 1 click to block or follow new followers from your notification emails"
["name"]=>
string(11) "djackmanson"
}
}
}
*/
 
var_dump($api->getSuggestions('topify'));
echo "\n";
 
/*
Response: the suggestions method isn't available yet, therefore no example.
*/