Trouble with statuses/home_timeline SOLVED


#1

Hello i have a problem with the home/timeline
I print the tweets of my timeline with the hour with succes :
echo $key->text.'<br>'.$key->created_at;
but i dont know how to add the user name of the man who habe tweeted this
I have tried $key->user-name but its doesnt work
If you have the solutions, please tell me
thx


#2

If you look at the structure of a user object, user-name is not a listed value. However screen_name is so I would recommend trying that.


#3

Hello Abraham, first, thanks for your awesome library,

I tried this too but i still have the same error :


#4

text and created_at are typically on a status object and screen_name is typically on a user object. If you get a status it will usually contain a user object and if you get a user it will usually contain a status object. You will have to figure out the hierarchy you are working with and the correct naming for it. E.g. I just used the GET statues/show endpoint and then used $status->user->screen_name.


#5

Thanks a lot, you was very helpfull to me :slight_smile: