-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
70 lines (56 loc) · 2.56 KB
/
example.html
File metadata and controls
70 lines (56 loc) · 2.56 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
<script type="text/javascript" src="jquery-1.7.1.min.js" /></script>
<script type="text/javascript" src="PeopleBrowsr.js" /></script>
<script type="text/javascript" src="Kred.js" /></script>
<script type="text/javascript">
//PeopleBrowsr API
/*
All PeopleBrowsr API requests use consistent parameters in making their requests.
For this library, due to security purposes the first two parameters are abstracted
into the PeopleBrowsrProxy file that handles authentication.
Time Period: The time period parameters require that exactly 2 of the three possible
parameters be submitted. Possible choices are 'first', 'last' (both of which denote
dates in any one of various formats. See https://developer.peoplebrowsr.com/pbapi/), and count
which denotes how many time increments the request should span. This defaults to days.
Therefore a value of 30 will denote a time span of 30 days.
source: Denotes the network from which the results should be pulled. blogs, facebook, twitter are all options
for this parameter.
term: The term or terms that should serve as the key for the search.
Optional Parameters:
period: defines the time span of the count parameter. This value is designated in seconds. period=86400 denotes one day.
limit: places a cap on the number of returned results
number: Specifies number of items in non-histogram queries. If the parameter &number=10, the query will only return 10 data points.
reverse: When set to reverse=true, this will reverse the order of the histograms, charts.
*/
$.ajax({
type : 'POST',
url : 'PeopleBrowsrProxy.php',
dataType : 'json',
data : 'method=atnamecloud&last=yesterday&term=pepsi&source=twitter&count=30',
success : function(data){
}
});
/*
A full list of PeopleBrowsr API method parameters can be found here: https://developer.peoplebrowsr.com/pbapi
*/
//Kred API
/*
All Kred API requests use consistent parameters in making their requests.
For this library, due to security purposes the first two parameters are abstracted
into the KredProxy file that handles authentication.
source: Denotes the network from which the results should be pulled. blogs, facebook, twitter are all options
for this parameter.
term: The term or terms that should serve as the key for the search.
*/
$.ajax({
type : 'POST',
url : 'KredProxy.php',
dataType : 'json',
data : 'method=kred&term=pepsi&source=twitter',
success : function(data){
alert(data.data[0].influence);
}
});
/*
A full list of Kred API method parameters can be found here: https://developer.peoplebrowsr.com/kred
*/
</script>