Search users and access user profile information without authorizing app


#1

Fflick.com used to be able to access user information and search for twitter users without having to authorize their app. Also, they used to be able to access user profile information using http://www.fflick.com/username as the url. Can the same be done now?

Every time we try to do it with the API mentioned at https://dev.twitter.com/docs/api/1/get/users/search, it asks us to authorize our app, which is not desirable. Are we using the wrong API? Is their any other API that will help us achieve the same without having to authorize our app everytime we try to do so.

A quick response would be very much appreciated.


#2

This is a good question…does anybody have an idea how this works?


#3

Rudrajit,

Can you tell me more about your scenario? The users/search API call has required authentication for as long as I can remember. Can you tell me more about how you make requests to that end point, what form of OAuth you’re using, who the “user” context is when you’re making the requests, how often are you making requests? Are they server side or client side? What’s the goal you’re trying to achieve with the method?


#4

We have user search section in our site (http://www.esolz.co.in/studio_tweet) where a user can search other users from twitter with their name (Ex: user put Bryan Adams ans checked the check box ) it will search all user name with Bryan Adams.We are using twitter oath api.Please check the following code

if(!empty($_GET[‘oauth_verifier’]) && !empty($_SESSION[‘oauth_token’]) && !empty($_SESSION[‘oauth_token_secret’])){
} else {
header(‘Location: twitter_login.php’);
}
$twitteroauth = new TwitterOAuth(‘s7USZrvC2a68gjC6g0TKg’, ‘xxx’, $_SESSION[‘oauth_token’], $_SESSION[‘oauth_token_secret’]);
$access_token = $twitteroauth->getAccessToken($_GET[‘oauth_verifier’]);
$_SESSION[‘access_token’] = $access_token;
$user_search = $twitteroauth->get(‘users/search’,array(‘q’=>$_SESSION[‘usersearch’]));
It would help a lot if we get quick response.


#5

what error’s does this script generate?


#6

It doesn’t necessarily generate an error. Just that it asks us to authorize our app everytime we run the script. Is there anyway we can bypass the app authorization thing as otherwise it can get annoying for the users.


#7

you could create an default user which access token your search system can use, however, keep in mind you will be limited to the 350 requests an hour, so caching should also be an good idea.


#8

can u provide us some some coding assistance or suggest us some url through which we can understand the procedure properly because we need to solve it asap.


#9

A bit of googling gave me this result: http://papermashup.com/using-the-twitter-search-api/

I think that will match your requirements and as far as I can check it, no user information is even needed.

Let me know if it works for you!


#10

Hi,

With the “papermashup script” that you provided- would that allow me to search for Twitter Users by using search keywords…lets say I was using the search keywords as “Kim Kardashian”- would the above script potentially search all profiles on Twitter that contain these keywords and then display them (without authorising the app)?


#11

from what I can make of it (its not my script) It searches for the keywords in tweets and returns those (see the demo: http://papermashup.com/demos/twitter-search.php?q=kim+kardashian&submit=Search)

Perhaps if you modify the script to only return the users it will do what you want it to, that shouldnt be too hard to do.


#12

ok i have changed the url to ($search = “http:api.twitter.com/1/users/search.json?q=madonna”:wink: inspte of ($search = “http://search.twitter.com/search.atom?q=".$q.":wink: and get the following error

Fatal error: Uncaught exception ‘Exception’ with message ‘String could not be parsed as XML’ in /var/www/custom/studio_tweet/Tests/twitter-search/twitter-search.php:153 Stack trace: #0 /var/www/custom/studio_tweet/Tests/twitter-search/twitter-search.php(153): SimpleXMLElement->__construct(’’) #1 {main} thrown in /var/www/custom/studio_tweet/Tests/twitter-search/twitter-search.php on line 153

Ihave downloaded the code from “http://papermashup.com/using-the-twitter-search-api/”.
and put the url as it is say in “https://dev.twitter.com/docs/api/1/get/users/search”.

Please tell me if i am wrong in any case.


#13

The User Search API and the Twitter Search API are two very different APIs with different response formats. You can’t use them quite the same way. It looks like your Search API script dealt with XML data in ATOM format – the Users Search API only supports JSON or XML (non-ATOM) formats.


#14

Hi, how do I create a default user with the access token that you mentioned? I basically want to be able to search twitter’s user’s based on a keyword AFTER authorising the app, but currently it keeps asking me to authorise the app everytime I search for a user.

Thanks


#15

Hi, how do I create a default user with the access token that you mentioned? I basically want to be able to search twitter’s user’s based on a keyword AFTER authorising the app, but currently it keeps asking me to authorise the app everytime I search for a user.

Thanks


#16

Hi, may i know how did you solve the code? Because, it appears null when i call $user_search.
Hope you can help me.
Thanks


#17

@plain_tweeting: Can you please clarify what the prob actually you are facing .


#18

fashion police killing me…hahaha


#19

hey @AsanthaDeAlwis did you ever get this working for yourself?


#20

Type