0

I wrote this simple code that works just fine :

        //access the twitter API using your twitter4j.properties file
    Twitter twitter = TwitterFactory.getSingleton();

    //create a new search
    Query query = new Query("\"your welcome\"");

    //get the results from that search
    QueryResult result = twitter.search(query);

    //get the first tweet from those results
    Status tweetResult = result.getTweets().get(0);

    //reply to that tweet
    StatusUpdate statusUpdate = new StatusUpdate(".@" + tweetResult.getUser().getScreenName() +" I believe you meant \"you're\" here?");
    statusUpdate.inReplyToStatusId(tweetResult.getId());
    Status status = twitter.updateStatus(statusUpdate); 

The problem is, even using my own parametres (Acessstoken, Consumerkey,,) that I generated manually from app.twitter.com, the code still sends the tweet to this account : Twit4j . it seems that too many had tweeted through it too!

twitter4j.proprieties is set up correctly libs are correctly integrated anyone knows what could be wrong ?

Rami Dridi
  • 311
  • 3
  • 16

1 Answers1

0

The Problem were (I guess) in the class name! the package name+ my class name are "Twitter" and the Object name from the Twitter4j is "Twitter" too! think the IDE got confused maybe ? anyway now it works just fine !

Rami Dridi
  • 311
  • 3
  • 16