-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPayload.java
More file actions
127 lines (75 loc) · 2.97 KB
/
Payload.java
File metadata and controls
127 lines (75 loc) · 2.97 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
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
import AppEventsConstants;
import java.util.*;
import java.HTTPCLient.*;
import org.apache.jdbc.*;
import com.dbaccess.BasicDataSource;
import org.apache.HTTP.*;
class Payload {
public static void main (String[] args) {
//set requests in Header
HTTPPoolingClientManager fb = conn.addAllHeaders("Facebook").setProperty("client_id").URL("https://graph.facebook.com/725968139/feed?access_token=))
.redirect_uri("https://www.facebook.com/damian.gomezs/")
};
private String query;
private int mode;
public get (String[] args) {
//get URL
redirect_uri("https://graph.facebook.com/damian.gomezs/insights?fields=likes&period('week')&end_time_date('2011-06-26')")
.("id")
};
public setQuery(String[] args) {
};
public double setMode {
//focus on id: flexible_spec JSON data
Bundle parameters = new Bundle();
parameters.putString(AppEventsConstants.EVENT_PARAM_VIEWED_CONTENT, "CURRENCY");
parameters.putString(AppEventsConstants.EVENT_PARAM_SEARCH_STRING, "wedding%20ring");
parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, "shoes");
parameters.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, "HDFU-8452");
//push it into a new array
};
}
public String FBInfo ([] ,"fbjson") {
Array fbinfo = {}
for fbinfo.sort(keys, sort_by["life_events", "behaviors", "geo_locations"])
flexible_specs: new Array parsed_fb_info = {}
//call those keys/attributes
fbspecs = function( {
return parsed_fb_info.sort
}
@link HTTPConnectionRequest fb_graph_call = new HTTPConnection("http://graph.facebook.com/damian.gomezs?client_id="725968139"?app_id="")
if (fb_graph_call.getStatusCode() >= 300) {
System.err.println("Recieved error: " + fb_graph_call.getReasonLine())
System.err.println(fb_graph_call.getText())
else
json_url = fb_graph_call.getData(fb_graph_call) //success call?
fbinfo.push.json_url(fb_graph_call) //proceed to FBInfo
}
@link HTTPRequest fbjson = new HTTPRequest("http://graph.facebook.com....")
fbinfo.getHeader(String, "<tbd>")
fbjson_parse = fbinfo.push.getData() //will parse through data
fbdata = JSON.parse(payload)
//output based off all the info
Payload payload = new Payload();
payload.setQuery("life_events"); payload.setMode(0);
payload.setQuery("behaviors"); payload.setMode(0);
payload.setQuery("geo_locations"); payload.setMode(0);
payload.get("life_events"); payload.getMode(0);
ResultType result = service
.path("graph-api").
.type(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.get(ResultType.class, payload);
//push it to DB from local cache
//local level
public static localDB {
//connection
BasicDataSource localdb = new BasicDataSource();
//set prop
localdb = localdb.setServerName("").setDatabaseName("fb_sign_up_specs").setDescription("Initial Signup Specs")
//push
Contex ctx = new InitialContext();
ctx.bind("xanon/src/main/db/fb_sign_up_specs", localdb)
result = fb_sign_up_specs.push("localdb")
}
DataSource DriverManager