id
stringlengths
36
36
text
stringlengths
1
1.25M
c500a52a-67b3-470b-a02f-caa8caa00cb3
public static JSONObject Logout() { JSONObject json = new JSONObject(); try { json.put ("output" ,"OK" ); } catch ( JSONException e ) { return Tools.erreur(e.getMessage()); } return json; }
6c1482f1-1e5a-48e9-910a-a9fcd0afaa51
public static JSONObject addComment(String key,String text){ if (key == null || text == null){ return Tools.erreur("Parametre manquant"); } else{ BDUser.addcomment(key, text); JSONObject json = new JSONObject(); try { json.put("output", "OK"); } catch (JSONException e) { return Tools.erreur...
28285f36-8c66-44eb-8f09-df4897a08884
public static JSONObject search(String key, String query, String friends) { if (key == null || query == null || friends == null) { return Tools.erreur("Parametre manquant"); //retourne un objet JSON avec un champ erreur ayant pour valeur "parametre manquant" } else{ //la BD doit faire quoi là ? normalemen...
8b039271-3d92-4440-b1d5-d0115cfe4514
public static JSONObject erreur(String s){ JSONObject json = new JSONObject(); try { json.put("error", s); } catch (JSONException e) { e.printStackTrace(); } return json; }
682a762a-1473-47af-8a4d-1680a3cbfe16
public static String genererCle(){ Random generateur = new Random(); String[] tab = {"0", "1","2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}; String s = ""; for (int i = 0; i<16; i++){ s+=tab[generateur.nextInt(16)]; } return s; }
6169bb17-892d-4f2a-9b71-bfe1e1efa776
public static DB getMongoDb() throws UnknownHostException{ MongoClient clientMongo = new MongoClient(mongo_host); DB db = clientMongo.getDB(mongo_db); return db; }
b7fc318b-f505-446f-a263-62025a405060
public static boolean userExists(String login){ DB db=null; try { db = DBStatic.getMongoDb(); DBCollection collection = db.getCollection("users"); // selection de la collection voulue BasicDBObject searchQuery = new BasicDBObject("login", login); // creation du champs recherchE DBCursor cursor = colle...
f961d3b0-60ac-465b-85df-baf0b4b3881e
public static void insertUser(String prenom,String nom,String login,String password){ DB db=null; try { db = DBStatic.getMongoDb(); DBCollection collection = db.getCollection("users"); // selection de la collection voulue BasicDBObject user = new BasicDBObject("nom", nom).append("prenom", prenom).append(...
182ce1ef-9d97-40e1-b96e-a5e6af101f7b
public static boolean verifLoginPassword(String login,String password){ DB db=null; try { db = DBStatic.getMongoDb(); DBCollection collection = db.getCollection("users"); // selection de la collection voulue BasicDBObject searchQuery = new BasicDBObject("login", login).append("password", password); // cr...
9274efa9-0f79-4074-bd9c-37056d62ddb6
public static void addFriend(String key, String id_friend) { // Connection c=null; // Statement st=null; // try { // int id_user=getUserByKey(key); //soit on fait une exception au lieu de renvoyer -1 dans la fonction, soit on crée une exception dans cette fct comme suit // if (sessionPerimee(key)||(id_...
a0ee40a0-f8a4-4bd0-8c8c-0aabe3cbb387
private static boolean sessionPerimee(String key) { // Connection c=null; // Statement st=null; // try { // Class.forName("com.mysql.jdbc.driver"); // c = DBStatic.getMysqlConnection(); // st = c.createStatement(); // int id_user = getUserByKey(key); // ResultSet r = st.executeQuery("SELECT...
0c5e3f29-ba27-4d02-8e47-8ee0862923de
private static int getUserByKey(String key) throws KeyUndefinedException { // Connection c=null; // Statement st=null; // try { // Class.forName("com.mysql.jdbc.driver"); // c = DBStatic.getMysqlConnection(); // st = c.createStatement(); // ResultSet r = st.executeQuery("SELECT * FROM Users WHE...
758b749e-cd84-47cb-ab57-29d7e9ffd79d
public static void removeFriend(String key, String id_friend) { // Connection c=null; // Statement st=null; // try { // int id_user=getUserByKey(key); // if (sessionPerimee(key)||(id_user==-1)){//on crée une erreur pour sortir directement et fermer la connection avec finally // throw new EndOfSess...
f02dbe32-6d48-458e-95cd-b6a01fc64c78
public static void addcomment(String key, String text) { try { int id=getUserByKey(key); if (sessionPerimee(key)||(id==-1)){//on crée une erreur pour sortir directement throw new EndOfSessionException("Session terminee"); } Mongo m = new Mongo("132.227.201.134",27017); DB db = m.getDB("li328"); ...
cb985a74-7e4b-40e6-8bb7-1c0b951d4a9b
public DataBase(String jndiname) throws SQLException{ try{ dataSource = (DataSource) new InitialContext().lookup("java:comp/env/" + jndiname); } catch (NamingException e){ throw new SQLException(jndiname + " is missing in JNDI ! : "+e.getMessage()); } }
8f0b873d-b487-411a-a40a-19943ca6cf9e
public Connection getConnection() throws SQLException{ return dataSource.getConnection(); }
a29cdbd9-5b59-4b3c-b6f2-4f85e64e2aba
public static void main(String[] args) throws Exception{ // TODO code application logic here consumer = new CommonsHttpOAuthConsumer(ConsumerKey,ConsumerSecret); consumer.setTokenWithSecret(AccessToken,AccessSecret); FriendFriendStdAttention(); }
3633bd5d-8af1-4ef1-8520-1307a5b26aae
public static void FriendFriendStdAttention() throws Exception { //FF //collect list of friend ids //collect tweets of friends //identify the tweets which are retweeted - R //identify the tweets which are retweeted by you - RU //initialization HttpGet request; Htt...
7ba1a69f-10eb-4465-9e3b-140a33549537
public static void main(String[] args) throws Exception{ // TODO code application logic here //<editor-fold defaultstate="collapsed" desc="Initialization"> consumer = new CommonsHttpOAuthConsumer(ConsumerKey,ConsumerSecret); consumer.setTokenWithSecret(AccessToke...
da2e9c74-447c-4990-88a8-c477382f8154
public static String readFile(String strUrl) throws Exception{ String line; BufferedReader reader; StringBuilder stringBuilder; reader=new BufferedReader(new FileReader(strUrl)); stringBuilder=new StringBuilder(); while((line=reader.readLine())!=null){ ...
c1f9e9a8-109a-40b2-9a5b-1a9addfcdaf7
public static String GetResponse(String url){ //initialization HttpGet request; HttpClient client; HttpResponse response; try{ request = new HttpGet(); client = new DefaultHttpClient(); request.setURI(new URI(url)); con...
1214753c-f0f5-4339-8dc8-82ec6ca74e8a
public static Boolean FileExistenceCheck(String strUrl)throws Exception{ File fileExistenceCheck; fileExistenceCheck=new File(strUrl); if(fileExistenceCheck.isFile()){ return true; } else { return false; } }
959e33de-aa97-4bed-a35a-c177d4e76c7a
public static List GetUsers(String strUrl) { String strUsers; StringTokenizer stringTokenizer; List listUsers; try{ strUsers=readFile(strUrl+"\\users\\getUsers.txt"); listUsers=new ArrayList<>(); stringTokenizer = new StringTokenizer(strUsers," "); ...
01e8108f-ea5c-4ea5-bf7a-fb63d4799f54
public static void SaveUsers(List listUsers,int intUserCount,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\users\\screen_name\\"+listUsers.get(intUserCount).toString()); if(!fileExistenceCheck.isDirectory()){ ...
172629b0-937e-4ed0-ada6-ee89e145b114
public static Map<String,List> GetUsersPendingRequests(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new Buffere...
5690c7de-78fc-44d3-94d2-a008e1586eb4
public static void PrintMap(Map mapPendingRequests){ String strScreenName; List listPendingRequests; List temp; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; while(iteratorMap.hasNext(...
f41e13c2-03af-4b92-b826-034955ea9743
public static Map<String,List> GetResetHashMap(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new BufferedReader(...
913dc6b2-cb29-4be3-a035-3db111d8da8d
public static int GetCountPendingRequests(Map mapPendingRequests){ String strScreenName; List listPendingRequests; int intPendingRequestsCount=0; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; w...
7c11305f-2631-46e8-93d9-6ba643f33054
public static String GetTweets(String Key,String Value){ String url; String strTweets; try{ url="http://api.twitter.com/1.1/statuses/user_timeline.json?"+Key+"="+Value+"&count=200"; strTweets=GetResponse(url); return(strTweets); } catch(Excepti...
2a0eed1b-faed-4fef-a784-4e57075e4092
public static void SaveTweets(List listUsers,int intUserCount,String strResponse,String strUrl) throws Exception{ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\tweets"); if(!fileExistenceCheck.isDirectory()){ //System.o...
dd159e12-b6b7-4fe8-b953-5a0378f958ea
public static String GetFriends(String Key,String Value) throws Exception{ //initialization String url; String strFriendIds; try{ url="http://api.twitter.com/1.1/friends/ids.json?"+Key+"="+Value; strFriendIds=GetResponse(url); ...
370f6c37-c4dc-4280-a232-074fcdcf3593
public static void SaveFriends(List listUsers,int intUserCount,List listFriends,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; int intFriendCount; for(intFriendCount=0;intFriendCount<listFriends.size();intFriendCount++){ fileExistenceCheck=ne...
57732584-e619-4667-92d0-8a797852d5fe
public static void SaveFriends(List listUsers,int intUserCount,String strResponse,String strUrl) throws Exception{ File file=new File(strUrl+"\\"+listUsers.get(intUserCount).toString()+"\\friends\\getFriends.txt"); BufferedWriter output = new BufferedWriter(new FileWriter(file)); output.write(st...
8b7955ac-9cde-47f3-b6de-ea7455aa4e24
public static void SaveUsersPendingRequests(List listUsers,Map mapPendingRequestsCurr,String strUrl) throws Exception{ File file=new File(strUrl); BufferedWriter output = new BufferedWriter(new FileWriter(file)); String strScreenName; List listPendingRequestsCurr; ...
1537dd8b-0a08-4d46-ab63-8f8910b321bf
public static void PrintLog(Map mapPendingRequestsCurr){ System.out.print("\n Curr: "); PrintMap(mapPendingRequestsCurr); int intTotalPendingRequests=GetCountPendingRequests(mapPendingRequestsCurr); System.out.print("\n Count: "+intTotalPendingRequests + " "); j...
8e4e6ad7-73d3-4689-8a5a-75da3b43daa6
public static void main(String[] args) throws Exception{ // TODO code application logic here //<editor-fold defaultstate="collapsed" desc="Initialization"> consumer = new CommonsHttpOAuthConsumer(ConsumerKey,ConsumerSecret); consumer.setTokenWithSecret(AccessToke...
aeb8c660-db8e-49cc-a178-f94e74272e03
public static String readFile(String strUrl) throws Exception{ String line; BufferedReader reader; StringBuilder stringBuilder; reader=new BufferedReader(new FileReader(strUrl)); stringBuilder=new StringBuilder(); while((line=reader.readLine())!=null){ ...
87cb0b07-dcbf-4562-893e-97534a2a8bbb
public static String GetResponse(String url){ //initialization HttpGet request; HttpClient client; HttpResponse response; try{ request = new HttpGet(); client = new DefaultHttpClient(); request.setURI(new URI(url)); con...
535e9548-0db6-4e56-85e0-66cb9a4a2881
public static Boolean FileExistenceCheck(String strUrl)throws Exception{ File fileExistenceCheck; fileExistenceCheck=new File(strUrl); if(fileExistenceCheck.isFile()){ return true; } else { return false; } }
f4351222-7148-4d55-85d2-340d4bde8297
public static List GetUsers(String strUrl) { String strUsers; StringTokenizer stringTokenizer; List listUsers; try{ strUsers=readFile(strUrl+"\\users\\getUsers.txt"); listUsers=new ArrayList<>(); stringTokenizer = new StringTokenizer(strUsers," "); ...
936f656b-8a1b-4e8b-b988-2ec793539433
public static void SaveUsers(List listUsers,int intUserCount,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\users\\screen_name\\"+listUsers.get(intUserCount).toString()); if(!fileExistenceCheck.isDirectory()){ ...
a2853463-9d35-41d4-921f-b9679aaf0c30
public static Map<String,List> GetUsersPendingRequests(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new Buffere...
e9e59f70-6927-49b0-b6d1-224ab7ef0cc6
public static void PrintMap(Map mapPendingRequests){ String strScreenName; List listPendingRequests; List temp; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; while(iteratorMap.hasNext(...
02167b31-f742-475e-8a1c-a0fd129a4368
public static Map<String,List> GetResetHashMap(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new BufferedReader(...
8a5d4aa8-d9dc-4d7b-aabc-436819cd2019
public static int GetCountPendingRequests(Map mapPendingRequests){ String strScreenName; List listPendingRequests; int intPendingRequestsCount=0; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; w...
7ea33a8c-5b8b-4042-bb32-4af0368d0b33
public static String GetTweets(String Key,String Value){ String url; String strTweets; try{ url="http://api.twitter.com/1.1/statuses/user_timeline.json?"+Key+"="+Value+"&count=200"; strTweets=GetResponse(url); return(strTweets); } catch(Excepti...
19321b25-e627-46c6-af96-f05c30f7058b
public static void SaveTweets(List listUsers,int intUserCount,String strResponse,String strUrl) throws Exception{ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\tweets"); if(!fileExistenceCheck.isDirectory()){ //System.o...
f6b036aa-f4e4-4a1b-a487-b6907b67ee2d
public static String GetFriends(String Key,String Value) throws Exception{ //initialization String url; String strFriendIds; try{ url="http://api.twitter.com/1.1/friends/ids.json?"+Key+"="+Value; strFriendIds=GetResponse(url); ...
30c93904-e88b-4a27-a439-e41512d4fd6a
public static void SaveFriends(List listUsers,int intUserCount,List listFriends,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; int intFriendCount; for(intFriendCount=0;intFriendCount<listFriends.size();intFriendCount++){ fileExistenceCheck=ne...
d9156bf3-96f1-4acb-af3d-5002ce709747
public static void SaveFriends(List listUsers,int intUserCount,String strResponse,String strUrl) throws Exception{ File file=new File(strUrl+"\\"+listUsers.get(intUserCount).toString()+"\\friends\\getFriends.txt"); BufferedWriter output = new BufferedWriter(new FileWriter(file)); output.write(st...
a4fe9308-ff8e-47d2-a6ef-2d95abdef1f6
public static void SaveUsersPendingRequests(List listUsers,Map mapPendingRequestsCurr,String strUrl) throws Exception{ File file=new File(strUrl); BufferedWriter output = new BufferedWriter(new FileWriter(file)); String strScreenName; List listPendingRequestsCurr; ...
94e9db2b-8e10-4799-ba69-0d8f293124dd
public static void PrintLog(Map mapPendingRequestsCurr){ System.out.print("\n Curr: "); PrintMap(mapPendingRequestsCurr); int intTotalPendingRequests=GetCountPendingRequests(mapPendingRequestsCurr); System.out.print("\n Count: "+intTotalPendingRequests + " "); j...
175f1fc8-e4e7-4d7f-9c09-e95ec2af0f83
public static void main(String[] args) throws Exception{ // TODO code application logic here //<editor-fold defaultstate="collapsed" desc="Initialization"> consumer = new CommonsHttpOAuthConsumer(ConsumerKey,ConsumerSecret); consumer.setTokenWithSecret(AccessToken,Access...
e3f98cbd-401b-403f-96aa-7ae36c38afed
public static String readFile(String strUrl) throws Exception{ String line; BufferedReader reader; StringBuilder stringBuilder; reader=new BufferedReader(new FileReader(strUrl)); stringBuilder=new StringBuilder(); while((line=reader.readLine())!=null){ ...
9ae8b5fd-bd6a-48db-82d3-d80af8d4370f
public static String GetResponse(String url){ //initialization HttpGet request; HttpClient client; HttpResponse response; try{ request = new HttpGet(); client = new DefaultHttpClient(); request.setURI(new URI(url)); con...
a81e303f-944a-4def-b444-a1d8c87379b9
public static Boolean FileExistenceCheck(String strUrl)throws Exception{ File fileExistenceCheck; fileExistenceCheck=new File(strUrl); if(fileExistenceCheck.isFile()){ return true; } else { return false; } }
20572942-7663-429a-98e3-d409913ca912
public static List GetUsers(String strUrl) { String strUsers; StringTokenizer stringTokenizer; List listUsers; try{ strUsers=readFile(strUrl+"\\users\\getUsers.txt"); listUsers=new ArrayList<>(); stringTokenizer = new StringTokenizer(strUsers," "); ...
cdde0fb0-08d6-4bb5-b52c-0d82b10acf00
public static void SaveUsers(List listUsers,int intUserCount,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\users\\screen_name\\"+listUsers.get(intUserCount).toString()); if(!fileExistenceCheck.isDirectory()){ ...
7e341891-c0cc-4f5e-bf22-8f8a41807f73
public static Map<String,List> GetUsersPendingRequests(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new Buffere...
151c9cef-222e-49df-83c4-dcf5460b9dff
public static void PrintMap(Map mapPendingRequests){ String strScreenName; List listPendingRequests; List temp; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; while(iteratorMap.hasNext(...
fc953cf1-a0a3-441f-8a22-1106b7508cfd
public static Map<String,List> GetResetHashMap(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new BufferedReader(...
c6014828-19fc-4e22-9e19-354ddd7e101c
public static int GetCountPendingRequests(Map mapPendingRequests){ String strScreenName; List listPendingRequests; int intPendingRequestsCount=0; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; w...
ae483074-9fb4-4640-94a5-64178211adce
public static String GetTweets(String Key,String Value){ String url; String strTweets; try{ url="http://api.twitter.com/1.1/statuses/user_timeline.json?"+Key+"="+Value+"&count=200"; strTweets=GetResponse(url); return(strTweets); } catch(Excepti...
b1c2f564-2107-4789-9d9b-4e575de22eef
public static void SaveTweets(List listUsers,int intUserCount,String strResponse,String strUrl) throws Exception{ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\tweets"); if(!fileExistenceCheck.isDirectory()){ //System.o...
e4e34ba7-0ad3-4b83-bc20-db6790e5b89e
public static String GetFriends(String Key,String Value) throws Exception{ //initialization String url; String strFriendIds; try{ url="http://api.twitter.com/1.1/friends/ids.json?"+Key+"="+Value; strFriendIds=GetResponse(url); ...
cce29264-d4d4-47b0-9a1b-26344f5483d0
public static void SaveFriends(List listUsers,int intUserCount,List listFriends,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; int intFriendCount; for(intFriendCount=0;intFriendCount<listFriends.size();intFriendCount++){ fileExistenceCheck=ne...
720ad4e8-7bbf-400f-8ef7-7d7ff31aa912
public static void SaveFriends(List listUsers,int intUserCount,String strResponse,String strUrl) throws Exception{ File file=new File(strUrl+"\\"+listUsers.get(intUserCount).toString()+"\\friends\\getFriends.txt"); BufferedWriter output = new BufferedWriter(new FileWriter(file)); output.write(st...
f9e4d7e9-7b19-4f2f-bb83-3e3a054c2e55
public static void SaveUsersPendingRequests(List listUsers,Map mapPendingRequestsCurr,String strUrl) throws Exception{ File file=new File(strUrl); BufferedWriter output = new BufferedWriter(new FileWriter(file)); String strScreenName; List listPendingRequestsCurr; ...
8846ef5e-ec70-4020-ac1e-9d36940173e6
public static void PrintLog(Map mapPendingRequestsCurr){ System.out.print("\n Curr: "); PrintMap(mapPendingRequestsCurr); int intTotalPendingRequests=GetCountPendingRequests(mapPendingRequestsCurr); System.out.print("\n Count: "+intTotalPendingRequests + " "); j...
d2c53b88-a64f-4aae-aa08-9729249edfdc
public static void main(String[] args) throws Exception{ // TODO code application logic here //<editor-fold defaultstate="collapsed" desc="Initialization"> consumer = new CommonsHttpOAuthConsumer(ConsumerKey,ConsumerSecret); consumer.setTokenWithSecret(AccessToken,Access...
fb49a830-e79a-4af6-b12d-9257972dc3de
public static String readFile(String strUrl) throws Exception{ String line; BufferedReader reader; StringBuilder stringBuilder; reader=new BufferedReader(new FileReader(strUrl)); stringBuilder=new StringBuilder(); while((line=reader.readLine())!=null){ ...
c0f86dde-019d-4d98-b30f-0a7d9d73998d
public static String GetResponse(String url){ //initialization HttpGet request; HttpClient client; HttpResponse response; try{ request = new HttpGet(); client = new DefaultHttpClient(); request.setURI(new URI(url)); con...
24dde218-38cb-4af1-820d-74b62062725c
public static Boolean FileExistenceCheck(String strUrl)throws Exception{ File fileExistenceCheck; fileExistenceCheck=new File(strUrl); if(fileExistenceCheck.isFile()){ return true; } else { return false; } }
0dac4f1b-986f-4b2e-b050-31ed4dbb3093
public static List GetUsers(String strUrl) { String strUsers; StringTokenizer stringTokenizer; List listUsers; try{ strUsers=readFile(strUrl+"\\users\\getUsers.txt"); listUsers=new ArrayList<>(); stringTokenizer = new StringTokenizer(strUsers," "); ...
1fe30a7f-b354-4505-8eb6-8eade69f91f9
public static void SaveUsers(List listUsers,int intUserCount,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\users\\screen_name\\"+listUsers.get(intUserCount).toString()); if(!fileExistenceCheck.isDirectory()){ ...
5c5a48ad-f000-4d40-afda-0047320cdc80
public static Map<String,List> GetUsersPendingRequests(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new Buffere...
6eeda5e2-b111-482b-a825-1db9168e8219
public static void PrintMap(Map mapPendingRequests){ String strScreenName; List listPendingRequests; List temp; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; while(iteratorMap.hasNext(...
a738c944-3867-4691-b6c7-a379ce767ae9
public static Map<String,List> GetResetHashMap(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new BufferedReader(...
5bdb6cad-757a-47b2-b16f-d152228f1c44
public static int GetCountPendingRequests(Map mapPendingRequests){ String strScreenName; List listPendingRequests; int intPendingRequestsCount=0; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; w...
a1e42c0b-f048-42f9-94a0-58cf56307664
public static String GetTweets(String Key,String Value){ String url; String strTweets; try{ url="http://api.twitter.com/1.1/statuses/user_timeline.json?"+Key+"="+Value+"&count=200"; strTweets=GetResponse(url); return(strTweets); } catch(Excepti...
047ab5ba-4a2d-4950-a83e-cb8280b46ea0
public static void SaveTweets(List listUsers,int intUserCount,String strResponse,String strUrl) throws Exception{ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\tweets"); if(!fileExistenceCheck.isDirectory()){ //System.o...
c673c9be-09fd-44b0-96ce-7b878499e21a
public static String GetFriends(String Key,String Value) throws Exception{ //initialization String url; String strFriendIds; try{ url="http://api.twitter.com/1.1/friends/ids.json?"+Key+"="+Value; strFriendIds=GetResponse(url); ...
0968d8d8-76f3-4347-be58-43d1d93a0650
public static void SaveFriends(List listUsers,int intUserCount,List listFriends,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; int intFriendCount; for(intFriendCount=0;intFriendCount<listFriends.size();intFriendCount++){ fileExistenceCheck=ne...
2941ea31-329e-463c-be55-4810447c09fd
public static void SaveFriends(List listUsers,int intUserCount,String strResponse,String strUrl) throws Exception{ File file=new File(strUrl+"\\"+listUsers.get(intUserCount).toString()+"\\friends\\getFriends.txt"); BufferedWriter output = new BufferedWriter(new FileWriter(file)); output.write(st...
cd52ab64-62b9-4864-9187-0c615d42577c
public static void SaveUsersPendingRequests(List listUsers,Map mapPendingRequestsCurr,String strUrl) throws Exception{ File file=new File(strUrl); BufferedWriter output = new BufferedWriter(new FileWriter(file)); String strScreenName; List listPendingRequestsCurr; ...
d858bbf2-9426-4f2f-92e2-b731a93a6cae
public static void PrintLog(Map mapPendingRequestsCurr){ System.out.print("\n Curr: "); PrintMap(mapPendingRequestsCurr); int intTotalPendingRequests=GetCountPendingRequests(mapPendingRequestsCurr); System.out.print("\n Count: "+intTotalPendingRequests + " "); j...
27ce4665-bb56-47b9-a031-52d8536a7574
public static void main(String[] args) throws Exception{ // TODO code application logic here //<editor-fold defaultstate="collapsed" desc="Initialization"> consumer = new CommonsHttpOAuthConsumer(ConsumerKey,ConsumerSecret); consumer.setTokenWithSecret(AccessToken,Access...
bd7a1935-9f36-46d4-a11d-1670a8afa397
public static String readFile(String strUrl) throws Exception{ String line; BufferedReader reader; StringBuilder stringBuilder; reader=new BufferedReader(new FileReader(strUrl)); stringBuilder=new StringBuilder(); while((line=reader.readLine())!=null){ ...
3a407960-841c-4be9-87d4-d9f4d0ad9f25
public static String GetResponse(String url){ //initialization HttpGet request; HttpClient client; HttpResponse response; try{ request = new HttpGet(); client = new DefaultHttpClient(); request.setURI(new URI(url)); con...
fc329b1f-07ff-419b-beeb-5fdf81a23830
public static Boolean FileExistenceCheck(String strUrl)throws Exception{ File fileExistenceCheck; fileExistenceCheck=new File(strUrl); if(fileExistenceCheck.isFile()){ return true; } else { return false; } }
cdbce85d-2f1d-401f-8473-70c09235824d
public static List GetUsers(String strUrl) { String strUsers; StringTokenizer stringTokenizer; List listUsers; try{ strUsers=readFile(strUrl+"\\users\\getUsers.txt"); listUsers=new ArrayList<>(); stringTokenizer = new StringTokenizer(strUsers," "); ...
b6123e08-e6bf-4e97-af2c-a24986857c56
public static void SaveUsers(List listUsers,int intUserCount,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\users\\screen_name\\"+listUsers.get(intUserCount).toString()); if(!fileExistenceCheck.isDirectory()){ ...
c40f3220-aeb4-4e6b-ab2e-4b870f906a56
public static Map<String,List> GetUsersPendingRequests(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new Buffere...
8b9da1ca-408f-4a11-ba73-d19f178e5c80
public static void PrintMap(Map mapPendingRequests){ String strScreenName; List listPendingRequests; List temp; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; while(iteratorMap.hasNext(...
72843a23-b21b-4593-8c5d-fa73fa370872
public static Map<String,List> GetResetHashMap(String strUrl)throws Exception{ String line; BufferedReader reader; List listPendingRequests; Map<String,List> mapPendingRequests = new HashMap<>(); int intPendingRequestTypeCount; reader=new BufferedReader(...
c844b916-3f8c-4712-919c-4fa76fc76f39
public static int GetCountPendingRequests(Map mapPendingRequests){ String strScreenName; List listPendingRequests; int intPendingRequestsCount=0; Iterator<Entry<String, List>> iteratorMap=mapPendingRequests.entrySet().iterator(); int intPendingRequestTypeCount; w...
744e3247-1229-4a51-9f96-e79d7ab7ec89
public static String GetTweets(String Key,String Value){ String url; String strTweets; try{ url="http://api.twitter.com/1.1/statuses/user_timeline.json?"+Key+"="+Value+"&count=200"; strTweets=GetResponse(url); return(strTweets); } catch(Excepti...
9f1c10b3-2824-4a56-8a1f-4abe52947153
public static void SaveTweets(List listUsers,int intUserCount,String strResponse,String strUrl) throws Exception{ File fileExistenceCheck; Boolean boolfileCreationCheck; fileExistenceCheck=new File(strUrl+"\\tweets"); if(!fileExistenceCheck.isDirectory()){ //System.o...
e63a5ae7-bac6-49f4-b682-4e3e330130f7
public static String GetFriends(String Key,String Value) throws Exception{ //initialization String url; String strFriendIds; try{ url="http://api.twitter.com/1.1/friends/ids.json?"+Key+"="+Value; strFriendIds=GetResponse(url); ...
88f5c60a-b416-4e9d-94da-b858d09f9f50
public static void SaveFriends(List listUsers,int intUserCount,List listFriends,String strUrl){ File fileExistenceCheck; Boolean boolfileCreationCheck; int intFriendCount; for(intFriendCount=0;intFriendCount<listFriends.size();intFriendCount++){ fileExistenceCheck=ne...