It might be the following but you can var_dump() $tweets and see the
structure of it to be sure.
foreach ($tweets as $tweet) {
echo $tweet->status->text;
}
Abraham
-
Abraham Williams | Hacker Advocate | http://abrah.am
Update: http://blog.abrah.am/2010/10/organizing-my-life.html
@a
Thanks again, but now am getting:
Warning: Invalid argument supplied for foreach()
It looks correct to me, so I'm confused about the warning.
Thanks
Lorraine
On Fri, Oct 1, 2010 at 3:54 AM, Abraham Williams <4bra...@gmail.com> wrote:
> You don't need the cURL and XML code.
>
> require_once('tw
You don't need the cURL and XML code.
require_once('twitteroauth.php');
$connection = new TwitterOAuth('consumer key', 'consumer secret', 'access
token', 'access token secret');
$tweets = $connection->get('statuses/friends_timeline');
$latesttweets = count($tweets);
foreach ($tweets->status as $t
Also wanted to mention that the original code is based on the tutorial here:
http://papermashup.com/using-the-twitter-api/
and the data is automatically inserted into a database.
Thanks,
Lorraine
Thank you so much, Abraham! I'm getting an error "String could not be parsed
> as XML" now- this is
Thank you so much, Abraham! I'm getting an error "String could not be parsed
as XML" now- this is what I now have (with my reset consumer keys put in
:-)):
require_once('twitteroauth.php');
$connection = new TwitterOAuth('consumer key', 'consumer secret', 'access
token', 'access token secret');
$t
Make sure you reset your consumer key on http://dev.twitter.com/apps and try
not to post them in public in the future.
This should work. I switched it to json as it didn't look like you needed
the actual xml and dropped the count as 20 is the default.
require_once('twitteroauth.php');
$connection
Maybe I should explain what I'm trying to do-- basically just want to
get my own status updates and the (public) details & updates of my
friends.
Would it work if I replaced this:
$login = "mytwitterusername:mytwitterpassword";
$tweets = "http://twitter.com/statuses/friends_timeline.xml?count=20";