[twitter-dev] Strange problems with Twitter API

218 views
Skip to first unread message

KPL

unread,
Apr 24, 2010, 12:20:51 AM4/24/10
to Twitter Development Talk
From past few days, I am trying to get the EpiTwitter library work for
me. But, it is behaving in unusually.

I am on Fedora 12 with PHP 5.3.2. It's my development box.

Here are the issues I am facing.

1.When I made a simple script with the method *getAuthenticateUrl* and
accessed it from http://localhost/ , it wasn't working and threw
errors(below) . But when I accidently tried http://127.0.01./ it
worked.

Fatal error: Uncaught exception 'EpiOAuthException' in /var/www/html/
twitter/classes/EpiOAuth.php:397
Stack trace:
#0 /var/www/html/twitter/classes/EpiOAuth.php(367):
EpiOAuthException::raise(Object(EpiCurlManager), false)
#1
/var/www/html/twitter/classes/EpiOAuth.php(39): EpiOAuthResponse-
>__get('oauth_token')
#2 /var/www/html/twitter/preview.php(34): EpiOAuth-
>getAuthenticateUrl(NULL, Array)
#3 {main}
thrown in /var/www/html/twitter/classes/EpiOAuth.php on line 397


2.After successful authentication, when returned to my script, it
works fine for the first time,when it is actually redirected by
Twitter.But when I refresh the page, it throws the following error -


Fatal error: Uncaught exception 'EpiOAuthUnauthorizedException' in /
var/www/html/twitter/classes/EpiOAuth.php:395
Stack trace:
#0 /var/www/html/twitter/classes/EpiOAuth.php(367):
EpiOAuthException::raise(Object(EpiCurlManager), false)
#1 /var/www/html/twitter/preview.php(48): EpiOAuthResponse-
>__get('oauth_token')
#2 {main}
thrown in /var/www/html/twitter/classes/EpiOAuth.php on line 395

Should this be problem with my server or cURL installation? When I
checked phpinfo(), cURL was enabled, but when I had a look in
Configure Command section, I saw this

'--without-curl'

Is there any relation of this with the errors?

Also, I was unable to access the responseText and the try-catch
combination with $e->getMessage(); didn't yeild any results.

Thanks in advance for your help.

Regards,
Kapeel S




--
Subscription settings: http://groups.google.com/group/twitter-development-talk/subscribe?hl=en

Patrick Kennedy

unread,
Apr 24, 2010, 1:41:55 AM4/24/10
to twitter-deve...@googlegroups.com
I also use epiTwitter. Using 'localhost' has worked for me, but
sometimes it breaks, and I now prefer 127.0.0.1.

As you note: after successful authentication with Twitter, it works
fine for the first time until page refresh. This means the oauth
tokens are not saved into session variables, a database, or cookies
for next use, such as on a page refresh. You need to save the tokens
for future access.

~Patrick

KPL

unread,
Apr 24, 2010, 5:39:21 AM4/24/10
to Twitter Development Talk
Patrick, thank you very much for your help.
You rock !
:-)


On Apr 24, 10:41 am, Patrick Kennedy <kenned...@gmail.com> wrote:
> I also use epiTwitter. Using 'localhost' has worked for me, but
> sometimes it breaks, and I now prefer 127.0.0.1.
>
> As you note: after successful authentication with Twitter, it works
> fine for the first time until page refresh.  This means the oauth
> tokens are not saved into session variables, a database, or cookies
> for next use, such as on a page refresh.  You need to save the tokens
> for future access.
>
> ~Patrick
>
> On Sat, Apr 24, 2010 at 11:20 AM, KPL <kapil.sa...@gmail.com> wrote:
> > From past few days, I am trying to get the EpiTwitter library work for
> > me. But, it is behaving in unusually.
>
> > I am on Fedora 12 with PHP 5.3.2. It's my development box.
>
> > Here are the issues I am facing.
>
> > 1.When I made a simple script with the method *getAuthenticateUrl* and
> > accessed it fromhttp://localhost/, it wasn't working and threw
Reply all
Reply to author
Forward
0 new messages