User Tools

Site Tools


java:miningthesocialweb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
java:miningthesocialweb [2014/01/27 22:40] rlunarojava:miningthesocialweb [2014/01/27 22:46] – [My first code] rlunaro
Line 1: Line 1:
-====== Mining the social web, 2nd edition ======+====== Mining the social web, 2nd edition in Java ======
  
 ===== Introduction ===== ===== Introduction =====
Line 49: Line 49:
                    
         cb.setDebugEnabled(true)         cb.setDebugEnabled(true)
-            .setOAuthConsumerKey(""+            .setOAuthConsumerKey("HERE-GOES-YOUR-CONSUMER-KEY") 
-        .setOAuthConsumerSecret(""+        .setOAuthConsumerSecret("HERE-GOES-YOUR-CONSUMER-SECRET") 
-        .setOAuthAccessToken(""+        .setOAuthAccessToken("HERE-GOES-YOUR-ACCESS-TOKEN") 
-        .setOAuthAccessTokenSecret("");+        .setOAuthAccessTokenSecret("HERE-GOES-YOUR-ACCESS-TOKEN-SECRET");
                      
         tf = new TwitterFactory(cb.build());         tf = new TwitterFactory(cb.build());
Line 95: Line 95:
     }     }
 } // exploringTrendingTopics } // exploringTrendingTopics
-<code>+</code>
  
 === Get trending topics by country === === Get trending topics by country ===
  
-It's possible that not all the trending topics can be consulted. For instance, I've tried with other locations (cities in Spain) and it doesn't work. +It's possible that not all the trending topics can be consulted. For instance, I've tried with other locations (cities in Spain) and it doesn't work. It does work searching for the trending topics of Spain, for instance. Would work searching for little countries like Andorra or Cittá del Vaticano? 
 + 
 +However, you should register in [[http://developer.yahoo.com/geo/geoplanet/|Yahoo! Geoplanet]] to get the ID for Spain or other country.
  
 <code java> <code java>
Line 108: Line 110:
 { {
  
-    GeoPlanet g = new GeoPlanet("");+    GeoPlanet g = new GeoPlanet("PUT-HERE-YOUR-PROJECT-CONSUMER-KEY");
     PlaceCollection places = g.getPlaces("Spain");     PlaceCollection places = g.getPlaces("Spain");
  
java/miningthesocialweb.txt · Last modified: 2022/12/02 22:02 by 127.0.0.1