I figured out the syntax :-
sid = JavaCast("long", session.homeTimeline_sid);
tPaging = createObject("java", "twitter4j.Paging");
tPaging.setSinceId(sid);
timeline = t4j.getHomeTimeline(tPaging);
Question
I have figured out how to send tweets and how to return the users Home Timeline. To return the timeline you just do the following :-
timeline = t4j.getHomeTimeline();
( where t4j is the twitter4j java object )
However in order to automate this ( i.e. call the timeline every 5 mins) i need to pass the last twitter ID to getHomeTimeline.
In the twitter4j JAVA examples there is the following java :-
Paging paging = new Paging(2, 40);
List statuses = twitter.getHomeTimeline(paging);
so I tried :-
timeline = t4j.getHomeTimeline(sid); throws a method not found or overloaded error
timeline = t4j.getHomeTimeline(1, sid); throws a method not found or overloaded error
sid = JavaCast("long", session.homeTimeline_sid);
timeline = t4j.getHomeTimeline(sid); throws a method not found or overloaded error
timeline = t4j.getHomeTimeline().Paging('sinceID',sid); Again an error
Does anyone know the correct syntax for this ???
La solution
I figured out the syntax :-
sid = JavaCast("long", session.homeTimeline_sid);
tPaging = createObject("java", "twitter4j.Paging");
tPaging.setSinceId(sid);
timeline = t4j.getHomeTimeline(tPaging);