Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions SWBSocialModel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,6 @@
<artifactId>tdb</artifactId>
<version>0.8.10</version>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-stream</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>com.tumblr</groupId>
<artifactId>jumblr</artifactId>
Expand Down Expand Up @@ -140,5 +130,15 @@
<artifactId>javaQuery</artifactId>
<version>5.0</version>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>4.0.4</version>
</dependency>
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-stream</artifactId>
<version>4.0.4</version>
</dependency>
</dependencies>
</project>
16 changes: 13 additions & 3 deletions SWBSocialModel/src/main/java/org/semanticwb/social/Twitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,21 @@ private ConfigurationBuilder configureOAuth(){
// .setOAuthAccessToken("1137512760-v65LXmL07hgaOzZPGN6xlSiJGPNCx3BkipAuvnZ")
// .setOAuthAccessTokenSecret("F4H9ruXp8YReBG28OTQyeEkHkHudm7IzMIbP8Ep8bzw");


cb.setDebugEnabled(true)
.setOAuthConsumerKey(getAppKey())
.setOAuthConsumerSecret(getSecretKey())
.setOAuthAccessToken(getAccessToken())
.setOAuthAccessTokenSecret(getAccessTokenSecret());

/*
cb.setDebugEnabled(true)
.setOAuthConsumerKey("hFze5AyPstGAWxGZOwuyaFVgX")
.setOAuthConsumerSecret("yR3ifgw15hNR4aCvrVV9AacHcRVY3O7O4B7OunXPZqmWhHFNvd")
.setOAuthAccessToken("47531700-BWlvGV4vIHfbSosm7HPTlqbDl5iZy7ppz55WwKciF")
.setOAuthAccessTokenSecret("tr3TCaG0x5rUOB4H7xbacqEhaq3Zt5GLHFyRjZduZBBDZ");
*/

/*
* When a twitter object is given use:
* Consumer Key: getAppKey()
Expand Down Expand Up @@ -401,8 +410,9 @@ public void listen(Stream stream) {

twitter4j.Query query = new Query(searchPhrases);
if(stream.getGeoCenterLatitude() != 0 && stream.getGeoCenterLongitude() != 0 && stream.getGeoRadio() > 0){
String distance_unit="km";
if(stream.getGeoDistanceUnit()!=null) distance_unit=stream.getGeoDistanceUnit();
Query.Unit distance_unit=query.KILOMETERS;
if(stream.getGeoDistanceUnit()!=null && stream.getGeoDistanceUnit().equalsIgnoreCase("KM")) distance_unit=query.KILOMETERS;
if(stream.getGeoDistanceUnit()!=null && stream.getGeoDistanceUnit().equalsIgnoreCase("MI")) distance_unit=query.MILES;
if(stream.getGeoRadio() < 50){
query.setGeoCode(new GeoLocation(stream.getGeoCenterLatitude(), stream.getGeoCenterLongitude()), 50, distance_unit);//(latitude, longitude), radius, units of distance
}else{
Expand Down Expand Up @@ -439,7 +449,7 @@ public void listen(Stream stream) {
aListExternalPost = new ArrayList();
do{
try{
//System.out.println("QUERY-Geprgy....: " + query);
//System.out.println("QUERY-Georgy24....: " + query);
twitter4j.QueryResult result = twitter.search(query);
int noOfTweets = result.getTweets().size();
//System.out.println("\ntweets by request: " + noOfTweets);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package org.semanticwb.social.base;


/**
* Autor: Jorge Jiménez
*/

/**
* Conjunto de Palabras a buscar dentro de los Post que llegan por el Listener y con las cuales se podra determinar el sentimiento y la intensidad de los mismos(Post).
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ private void initAnalysis() {
//System.out.println("Geo-1---Lat:"+stream.getGeoCenterLatitude()+"/long:"+stream.getGeoCenterLongitude()+",classifyGeoLocation:"+classifyGeoLocation);
//System.out.println("Geo-2--Lat:"+externalPost.getLatitude()+",Long:"+externalPost.getLongitude());
if (stream.getGeoCenterLatitude() != 0 && stream.getGeoCenterLongitude() != 0 && classifyGeoLocation) {
//System.out.println("Geo-1---Lat:"+stream.getGeoCenterLatitude()+"/long:"+stream.getGeoCenterLongitude());
//System.out.println("Geo-1---LatJoerge:"+stream.getGeoCenterLatitude()+"/long:"+stream.getGeoCenterLongitude());
if (externalPost.getLatitude() != 0 && externalPost.getLongitude() != 0) {
//System.out.println("Geo-2--Lat:"+externalPost.getLatitude()+",Long:"+externalPost.getLongitude());
double eart_Radio = SWBSocialUtil.EART_RADIUS_KM; //Por defecto se mide en Kilometros
Expand Down
Loading