Re: [twitter-dev] Re: How do I get the id of the last status update?

2010-09-22 Thread Abraham Williams
$status is an object which contains a parameter of id.  So you to echo the
id you need to do:

echo $status->id;

Abraham
--
Evobots configured this transmission while traveling at 50 billion times the
speed of light.
On Sep 22, 2010 2:52 PM, "Polskaya"  wrote:
> Thank you Abraham for your swift reply!
>
> This is the code I use now:
>
> $status = $connection->post('statuses/update', array('status' =>
> 'mmmdedju'));
> $status->id;
> echo $status;
>
> I get error Catchable fatal error: Object of class stdClass could not
> be converted to string in /home/polskaya/public_html/140karakters/
> twitterapi/test.php on line 23
>
> Line 23 is echo $status;
>
> What am I overlooking?
>
>
> On 22 sep, 23:16, Abraham Williams <4bra...@gmail.com> wrote:
>> $status = $connection->post('statuses/update', array('status' => 'text to
>> post'));
>>
>> $status->id;
>>
>> 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 Wed, Sep 22, 2010 at 13:58, Polskaya  wrote:
>> > Hi all,
>> > I got a bit stuck I'm afraid.
>> > I have a single user application. Using the code below, I can post a
>> > status update. However, I would like to receive the id of that last
>> > update.
>>
>> > include('oAuth/twitteroauth.php');
>> > define("CONSUMER_KEY", "***");
>> > define("CONSUMER_SECRET", "***");
>> > define("OAUTH_TOKEN", "***");
>> > define("OAUTH_SECRET", "***");
>> > $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
>> > OAUTH_TOKEN, OAUTH_SECRET);
>> > $content = $connection->get('account/verify_credentials');
>> > $connection->post('statuses/update', array('status' => 'text to
>> > post'));
>>
>> > Anyone with a clue? Thx in advance! :)
>>
>> > --
>> > 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

-- 
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-dev] Re: How do I get the id of the last status update?

2010-09-22 Thread Polskaya
My fault! I should have done
print $status->id;
not
print $status

Thanks again for your help Abraham!



On 22 sep, 23:52, Polskaya  wrote:
> Thank you Abraham for your swift reply!
>
> This is the code I use now:
>
> $status = $connection->post('statuses/update', array('status' =>
> 'mmmdedju'));
> $status->id;
> echo $status;
>
> I get error Catchable fatal error: Object of class stdClass could not
> be converted to string in /home/polskaya/public_html/140karakters/
> twitterapi/test.php on line 23
>
> Line 23 is echo $status;
>
> What am I overlooking?
>
> On 22 sep, 23:16, Abraham Williams <4bra...@gmail.com> wrote:
>
> > $status = $connection->post('statuses/update', array('status' => 'text to
> > post'));
>
> > $status->id;
>
> > 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 Wed, Sep 22, 2010 at 13:58, Polskaya  wrote:
> > > Hi all,
> > > I got a bit stuck I'm afraid.
> > > I have a single user application. Using the code below, I can post a
> > > status update. However, I would like to receive the id of that last
> > > update.
>
> > > include('oAuth/twitteroauth.php');
> > > define("CONSUMER_KEY", "***");
> > > define("CONSUMER_SECRET", "***");
> > > define("OAUTH_TOKEN", "***");
> > > define("OAUTH_SECRET", "***");
> > > $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
> > > OAUTH_TOKEN, OAUTH_SECRET);
> > > $content = $connection->get('account/verify_credentials');
> > > $connection->post('statuses/update', array('status' => 'text to
> > > post'));
>
> > > Anyone with a clue? Thx in advance! :)
>
> > > --
> > > 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


[twitter-dev] Re: How do I get the id of the last status update?

2010-09-22 Thread Polskaya
Thank you Abraham for your swift reply!

This is the code I use now:

$status = $connection->post('statuses/update', array('status' =>
'mmmdedju'));
$status->id;
echo $status;

I get error Catchable fatal error: Object of class stdClass could not
be converted to string in /home/polskaya/public_html/140karakters/
twitterapi/test.php on line 23

Line 23 is echo $status;

What am I overlooking?


On 22 sep, 23:16, Abraham Williams <4bra...@gmail.com> wrote:
> $status = $connection->post('statuses/update', array('status' => 'text to
> post'));
>
> $status->id;
>
> 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 Wed, Sep 22, 2010 at 13:58, Polskaya  wrote:
> > Hi all,
> > I got a bit stuck I'm afraid.
> > I have a single user application. Using the code below, I can post a
> > status update. However, I would like to receive the id of that last
> > update.
>
> > include('oAuth/twitteroauth.php');
> > define("CONSUMER_KEY", "***");
> > define("CONSUMER_SECRET", "***");
> > define("OAUTH_TOKEN", "***");
> > define("OAUTH_SECRET", "***");
> > $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
> > OAUTH_TOKEN, OAUTH_SECRET);
> > $content = $connection->get('account/verify_credentials');
> > $connection->post('statuses/update', array('status' => 'text to
> > post'));
>
> > Anyone with a clue? Thx in advance! :)
>
> > --
> > 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