Anyone knows how can I use twitter directly whitout asking for credential and not using OAuth library?
I want to put the credentials directly in the code and authorize the app, and then just see the home timeline.
I tried using jTwitter library but when I use the method getHomeTimeline it throws the error "Bad request".
Here is my code example:
try {
winterwell.jtwitter.Twitter tw = new winterwell.jtwitter.Twitter("UserName","Password");
List<winterwell.jtwitter.Twitter.Status> ls = tw.getHomeTimeline();
for (winterwell.jtwitter.Twitter.Status status : ls) {
System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
}
}
catch (TwitterException e) {
e.printStackTrace();
System.out.println("Failed to get timeline: " + e.getMessage());
}
Thanks in advance!