Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieve twitter user avatar in RoR
    primarykey
    data
    text
    <p>I'm working on a personal project just to get my hands dirty with RoR. What I'm trying to do is a very simple twitter search engine using the Twitter gem. Calling the <strong>Twitter.search</strong> method with various options I can accomplish this goal easily. My problem is:</p> <p>How do I show the user avatar of each tweet I retrieved from the search ?</p> <p>I managed to get the json url and parse it, but I'm getting the Bad Authentication Data message:</p> <pre><code>{"errors"=&gt;[{"message"=&gt;"Bad Authentication data", "code"=&gt;215}]} </code></pre> <p>I know that this might be an OAuth problem but even though I've been reading about it, I kinda get confused on how to properly use it. Is it needed to do the OAuth approval dance on a per-user basis (and eventually how) or am I able to hard-code the values from the Twitter dashboard as I did to get the results from the search (which apparently doesn't work for the avatar)?</p> <p>I have my twitter.rb file like this:</p> <pre><code>Twitter.configure do |config| config.consumer_key = 'key' config.consumer_secret = 'secret' config.oauth_token = 'token' config.oauth_token_secret = 'token-secret' end </code></pre> <p>I thought that retrieveing the user json from *<a href="https://api.twitter.com/1.1/users/show.json?user_id=" rel="nofollow">https://api.twitter.com/1.1/users/show.json?user_id=</a>...* would work but I don't know how to get the authorization for that. There are many similar questions but I still couldn't understand how to solve this problem. Any help would be much appreciated.</p> <p><strong>EDIT:</strong> In the twitter API doc related to this it says "<em>Use the OAuth tool in this page sidebar to generate the OAuth signature for this request.</em>" but I don't understand how to use the signature to authorize the request (if that is the actual problem)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload