How to get (scrape) the contents of a site that requires logging in through YQL? - yql

Is it possible to get (scrape) data from a site that requires logging in using YQL? If yes, please tell the procedure.

You'll need the user to authorize your access via OAuth, as YQL's docs mention. In addition to the docs pointed to by links from the URL I just mentioned, you can learn all about OAuth here, then get libraries to help you use OAuth, depending of course on the programming language you want to use, from the links listed here.

Depending on how the remote site is set up, you could use a simple POST (there is an open data table for that1) or you could create your own small, custom data table and use <execute>2 to send whatever headers (including Cookie:) you need over one or more GET/POST requests.
htmlpost data table (example)
YQL Execute

Related

Using the ProfileAdminService to Follow a user

I'm trying to figure out if there's a way to use the ProfileAdminService (com.ibm.sbt.services.client.connections.profiles.ProfileAdminService) to get one user to follow another user.
I can see that you can do it via a put to /profiles/admin/atom/following.do but I was hoping to just use service.
I've investigated the FollowService but this only (at least that i can see) allows the current authenticated user to follow someone, but I want to be able to get any user to follow someone.
Thanks
The feature was not implemented in the IBM Social Business Toolkit SDK
you can look at the Code for ProfileAdminService and you'll see the methods do not include establishing a following relationship.
You need to use the REST API - http://www-10.lotus.com/ldd/lcwiki.nsf/xpAPIViewer.xsp?lookupName=IBM+Connections+5.0+API+Documentation#action=openDocument&res_title=Following_a_person_using_the_Administration_API_ic50&content=apicontent
with the specified body. You need to craft the URL properly in order to get the feature to work via the REST API

Was it able to retrieve data from a external web site which does not provide a API using YQL?

I'd like to retrieve data from a web site ,which does not provide a API
Can I retrieve data using YQL?
ie: Can I custom the data parse in the target URI with YQL?
Yes, you can. This is one of the most popular use case of YQL. Here is a sample. But it is not working when trying to retrieve data from web-page which is dissallowed for spider access (via robots.txt, for example).
Without knowing what you're trying to do, the only reasonable answer here is…
Yes.

Display twitter feeds

For an event in a couple of weeks I'd like to make an web page/app which display tweets from a specific user, a specific hashtag and all #reply's at the first user in 3 boxes on the screen.
However I've never tried this. I want to use either .NET (C#) or HTML/CSS/JS since I'm proficient in those. Are there any libraries/API's I can use? Or is there an readily available freeware/open-source app I can use?
Have you seen TweetSharp?
Use Twitter's profile and search widgets. Profile for the first box, a search of the hash tag for the second box, and a search of to:username for the third box.
I actually just posted this as an answer to another question:
I just updated a plugin to work with the Twitter 1.1 API. Unfortunately, per Twitter's urging, you will have to perform the actual request from server-side code. However, you can pass the response to the plugin and it will take care of the rest. I don't know what framework you are running, but I have already added sample code for making the request in C#, and will be adding sample code for PHP, shortly.
The plugin makes a call to statuses/user_timeline, but you will likely want to look at statuses/filter or statuses/search, instead. All you will have to do is add your desired parameters (hashtag, replies, etc.) to the server-side code and it should work (with the addition of your security keys and tokens, of course).
Good luck! :)

Enable Query Strings in Code Igniter

I am trying to implement Twitter's OAuth into my Code Igniter web application at which the callback URL is /auth/ so once you have authenticated with Twitter you are taken to /auth/?oauth_token=SOME-TOKEN.
I want to keep the nice clean URL's the framework provides using the /controller/method/ style of URL but I want to enable query strings as well, there will only ever be one name of the data oauth_token so it's ok if it has to be hard coded.
Any ideas?
I have tried tons of the things people are saying to do, but none work :(
PS: I'm using the .htaccess method of URL rewriting.
There are several ways to handle this.
Most People, and Elliot Haughin's Twitter Lib, extend the CI_Input library with a MY_Input library that sets allow_query_strings to true
You will also need to add ? to the allowed characters in config/config.php and set $config['url_protocal'] to PATH_INFO
see here: Enable GET in CodeIgniter
Codeigniter Reactor lets you access $_GET directly or via $this->input->get(). You don't need to use MY_Input or even change your config.php. This method leaves the query string in the URL, however.
I used a hacked index.php to recognise users coming back from Twitter, check for valid and safe values, then re-direct it to to a CodeIgniter friendly URL.
It may not be to everyones taste but I preferred it over allowing query strings throughout the entire application instead of just one particular circumstance.

using APIs with oauth for single user

I'm trying to make use of various APIs including twitter, youtube, etc because we want to embed recent entries (tweets, videos) on our website.
However, since I'm just retrieving my own data, I'm wondering how I can do this simpler than the multi-step process required by OAuth.
Twitter provides me with my own access token I can use directly, so that kinda works, but I can't find any such token in the YouTube documentation.
So how am I supposed to make use of the api if I just want to get a simple list of stuff? how exaclty am I supposed to authenticate my own website to use my own account?
I think i might have things all wrong and if so please point me in the right direction. I tried using rss feeds but they don't give me as much control over what I retrieve as using the API directly...
any insight or suggestions are appreciated!
see my comment above. summary: it depends on the requirements of the individual api

Resources