简体   繁体   中英

Rails - Twitter API: how to get from ID link to Twitter profile?

From the Twitter API I obtain user's ID (of course beside profile link, username etc). How can I display the link to user's profile according his ID?

For example, Facebook API provide user's ID as well, and if I put to the browser www.facebook.com/users_id , I'll get his profile...

Is there any way to do with Twitter? www.twitter.com/users_id returns empty page...

EDIT: obviously I can save user's URL (or his username), but the respective user can whenever change it...

what do you call a twitter "profile" ? I guess you talk about the user timeline

according to the api doc, your url should probably look like this :

https://api.twitter.com/1/statuses/user_timeline.html?&user_id=(your_id_here)

however, i would advise to use one of the twitter api gems to ease your pain...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM