Re: [twitter-dev] Twitter xauth login for posting and receiving Tweets

2010-09-15 Thread Zahid Naqvi
did you get the xAuth permissions from the twitter?


--

*Thanks & Regards*

*Zahid Naqvi | Senior Software Engineer*
--
*
G1-11, I.T.Park, M.I.A. (Extn.) Udaipur - 313003 Rajasthan India
(M) *+91-9799966000* | (R) *+91-141-2608333*
*zahidalina...@gmail.com | za...@arcgate.com





On Thu, Sep 16, 2010 at 1:02 AM, Ernandes Jr.  wrote:

> Your code looks OK! Either your problem is related to your keys our your
> environment. Have you tryied to run you code on a real device?
>
>
> On Wed, Sep 15, 2010 at 6:30 AM, vinod  wrote:
>
>> Hi,
>> Hi,
>>
>> I imported the libraries:
>>
>> xauth-encoders.jar
>> kxml2-min-2.3.0.jar,
>> mobile-ju-framework-1.0.jar
>> twitter_api_me-1.3.jar
>>
>>
>> After using Ernandes library i am receiving errors as below
>> I used single access token here
>> verification of credentials are successfull. but failed to Tweet and
>> received below errors
>>
>> In WTK 3.0
>> javax.microedition.io.ConnectionNotFoundException: ConnectionNotFound
>> error in socket::open : error = 10060
>>
>> In WTK 2.5.2
>> java.lang.SecurityException: Invalid / expired Token
>>
>> Source is as follows:
>>
>> Token token = new Token("token_access", "token_secret");
>> Credential c = new Credential("rahulka...@gmail.com",
>> "8oHIBK7T90Ye7GjIF6SToA",
>> "4Ebm4f7bie2AAYyN75DxwSUYeg8x0SBlL0IyKIXzaw", token);
>> UserAccountManager m = UserAccountManager.getInstance(c);
>> try {
>> if (m.verifyCredential()) {
>> System.out.println("Consumer or token keys are success");
>> Tweet t = new Tweet("Hi!!! This is my first tweet via Twitter API
>> ME.");
>> TweetER ter = TweetER.getInstance(m);
>> t = ter.post(t);
>>
>> } else {
>> System.out.println("Consumer or token keys are invalid!");
>> }
>> } catch (Exception ex) {
>> System.out.println("Exception here1="+ex);
>> }
>>
>> If i use normal credentials my application is not able to validate
>> credentials itself
>>
>> In WTK 3.0
>>
>> javax.microedition.io.ConnectionNotFoundException: ConnectionNotFound
>> error in socket::open : error = 10060
>>
>> In WTK 2.5.2
>>
>> Credentials unsucessfull
>>
>> Also when i am not able to import Equifax cert
>> Please help to authentication, post and receive tweets using my
>> application.
>>
>> Regards,
>> Basu
>>
>> --
>> Twitter developer documentation and resources: http://dev.twitter.com/doc
>> API updates via Twitter: http://twitter.com/twitterapi
>> Issues/Enhancements Tracker:
>> http://code.google.com/p/twitter-api/issues/list
>> Change your membership to this group:
>> http://groups.google.com/group/twitter-development-talk?hl=en
>>
>
>
>
> --
> Ernandes Jr.
> -
> "ALL programs are poems. However,
> NOT all programmers are poets."
>
>  --
> Twitter developer documentation and resources: http://dev.twitter.com/doc
> API updates via Twitter: http://twitter.com/twitterapi
> Issues/Enhancements Tracker:
> http://code.google.com/p/twitter-api/issues/list
> Change your membership to this group:
> http://groups.google.com/group/twitter-development-talk?hl=en
>

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en


Re: [twitter-dev] Re: list api create_all method not working

2010-09-14 Thread Zahid Naqvi
Hi,

Can anyone suggest me that how i can integrate my Blackberry application
with twitter.

I am using Twitter me 1.4 api for this.


--

*Thanks & Regards*

*Zahid Naqvi | Senior Software Engineer*
--
*
G1-11, I.T.Park, M.I.A. (Extn.) Udaipur - 313003 Rajasthan India
(M) *+91-9799966000* | (R) *+91-141-2608333*
*zahidalina...@gmail.com | za...@arcgate.com





On Tue, Sep 14, 2010 at 10:41 PM, Ken  wrote:

> Finally, after discovering this thread, I added /members/ to the
> create_all endpoint and was able to add 98 members to a list. As
> twitter would say, 'Yay'...
>
> I filed a bug to have the documentation corrected.
>
> Are there still problems adding lots of members, as reported earlier
> in this thread? Since rate-limiting as listed as false in the doc,
> would it be more reliable to just loop over :user/:list_id/members 100
> times? I need to go for "reliable" wherever possible... That way we
> could add up to the 500 members maximum. Recommended or not really?
>
> Thanks
> -Ken
>
>
> On Aug 23, 9:07 pm, Jim Chevalier  wrote:
> > Hello,
> >
> > Ah-ha! I did not have /members/ in my POST URL.  Thanks for pointing
> > that out!
> > This actually make it seem likehttp://
> dev.twitter.com/doc/post/:user/:list_id/create_all
> > should be changed to state:
> > POSThttp://
> api.twitter.com/version/:user/:list_id/members/create_all.format
> >
> > I also didn't realize I could/should check on $connection->http_code
> > so often.  Thanks for pointing that out as well.
> > It's funny, now that you mention it, I notice the test.php file you
> > included in twitteroauth has that call *everywhere*.
> >
> > It seems like I should rewrite my calls to be more like the
> > "twitteroauth_row" function you define in the test.php file so that I
> > can use the $connection->http_code results as error-checking.
> > I'll also have to test if setting "public $retry = TRUE;" in the
> > twitteroauth.php file helps with the 502 response that comes when
> > attempting to push 99 users through the create_all call...
> >
> > Thanks for all the help!
> > -Jim
> >
> > On Aug 23, 2:44 pm, Abraham Williams <4bra...@gmail.com> wrote:
> >
> > > After each TwitterOAuth call you should check $connection->http_code to
> > > check what the result is. 200 on success, 404 on not found, etc.
> >
> > > My quick findings:
> > > Works: $connection->post('abraham/test3/members/create_all',
> array('user_id'
> > > => $user_ids));
> > > AKA: $connection->post('{$screen_name/{$list}/members/create_all',
> > > array('user_id' => $user_ids));
> >
> > > But with the 99 user_ids it would usually return a 502 after adding ~60
> > > users to the list:http://goo.gl/Zur3
> >
> > > Abraham
> > > -
> > > Abraham Williams | Hacker Advocate |http://abrah.am
> > > @abraham |http://projects.abrah.am|http://blog.abrah.am
> > > This email is: [ ] shareable [x] ask first [ ] private.
> >
> > > On Mon, Aug 23, 2010 at 10:54, Jim Chevalier 
> wrote:
> > > > hrm, back to square one then...
> >
> > > > Abraham - the value of $users is:
> >
> > > >
> 2142731,14125623,15998931,19560364,16559320,17036420,14791918,16908659,5538992,14984281,20188175,14277276,111226850,14327961,20257060,94168006,107679193,54567920,18171797,8886022,16390772,69422500,171538302,818340,168929218,141333525,132534968,14124542,14408989,138293290,2039761,6752072,111896485,175801197,14912789,22907920,15099178,16583906,10870772,94269486,174521748,82002786,15395087,39407092,123734452,17193910,16362662,7762662,21514744,7596972,31563269,23147529,27440127,14337563,1528701,82497472,19251912,15292430,17005679,7192042,14600753,97484744,2023641,92086501,15447441,98735657,16950385,2023191,14411651,23111875,2900,15039436,14479810,16024218,57933102,8453452,18363508,16569530,21034443,17007607,7029452,54997124,47397228,15226527,18193201,22278762,15127641,14204449,60616288,16465359,10371312,15805506,14995035,27727035,19211127,35279958,18023868,9369722,8088412
> >
> > > > That's 99 users, in what I believe to be the correct format.
> >
> > > > I also ran a test with just 8088412 like this, with the same (blank)
> > > > result:
> > > > $users = 8088412;
> > > > $added = $connection->post("{$user->screen_name}/lists/$listid->id/
> > > > create_all", array('user_id' => $users));
&g

[twitter-dev] How to use TwitterME on Blackberry....

2010-09-14 Thread Zahid Naqvi
Hello,

I am new with twitterme api and i am making an application on
blackberry which will post the articles on the twitter.

i registered my application with the twitter and get the token and
keys.

what i want in my application that whenever user provide there
credentials than i want to post one article on twitter. right now i m
providing the token like :

Token  token = new Token("49990287-
c8KzOReuyZwMxSXr33R884wCpPAFWKYnsQVFgyWFZUw",
"KR8B9q92dxcdzGcNIugYYg645knu6b9HSR6vsh0lth0jE4");

these parameters i m putting hard coded

how i can get these parameters dynamically according to the user
credentials.

whenever i m running the below code than its posting on my twitter.
but i want that who ever will use my applcation provide the username/
pwd of twitter and than post article.

do u have any sample code which runs finely on blackberry and posting
on twitter according to the username/pwd.

sometimes i m getting the LimitExceedException.

My Code :

MainScreen screen = new MainScreen();

//Token  token = new Token("token_access", "token_secret");
Token  token = new Token("49990287-
c8KzOReuyZwMxSXr33R4wCpPAFWKYnsQVFgyWFZUw",
"KR8B9q92dxcdzGcNIugYYgknu6b9HSR6vsh0lth0jE4");

XAuthSigner xc=new
XAuthSigner("RbMzin97EOIe47kTiX3qpA","qn2vhn4xvErTx9qGw95sRPMcemFQUejw87g1lqGNYk");

xc.sign(new HttpRequest("http://api.twitter.com";), token);


Credential c = new Credential("zahidalinaqvi",
"RbMzin97EOIe47kTiX3qpA",
"qn2vhn4xvErTx9qGw95sRPMcemFQUejw87g1lqGNYk", token);

UserAccountManager m = UserAccountManager.getInstance(c);

try {
if (m.verifyCredential()) {
//GeoLocation loc = new GeoLocation("+37.5", "+26.7");
Tweet t = new Tweet("Cool! Geo-located tweet via Twitter
API ME.");

TweetER ter = TweetER.getInstance(m);

t = ter.post(t);

}
} catch (IOException e) {
System.out.println(e.getMessage());
e.printStackTrace();
} catch (LimitExceededException e) {
System.out.println(e.getMessage());
e.printStackTrace();
}

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en