Posted by infojunkie on March 21, 2010 at 9:58am
Feeds OAuth provides a new Feeds fetcher plugin that performs OAuth or OAuth 2.0 authorization before requesting a feed.
Installation
- For OAuth 1.0: Install PECL::oauth
- For OAuth 2.0: Install php-proauth inside the module folder using the following script:
svn checkout http://php-proauth.googlecode.com/svn/trunk/ php-proauth-read-only
Usage
- Obtain standard OAuth information from host: consumer key, consumer secret, request token URL, access token URL, authorize URL.
- Create a new Feeds importer and select the fetcher to be of type OAuthHTTPFetcher or OAuth2HTTPSFetcher.
- In the fetcher settings, enter the OAuth information above, as well as a unique site identifier that represents the host (e.g., twitter).
- When saved, the configuration screen will show you a callback URL: add it to the host's configuration for your Drupal site.
- Associate the new importer with a content type.
- When you create a new node of this content type, the form will warn you that you haven't received an authorization from the host. Click the link to do so and complete the authentication steps.
- OAuth 2.0: you can also enter the
scopeargument that's sent during authorization, to request special permissions from the server. - You're now ready to create new feeds from your protected data!
Compatibility with other OAuth modules
Other modules, such as Twitter Signin, already provide OAuth authentication and store tokens in their own tables. Feeds OAuth must be able to retrieve the tokens stored by those third party modules. To do so, a new hook hook_feeds_oauth_authenticator is used. Here's the implementation for Twitter Signin:
<?php
function twitter_feeds_oauth_authenticator() {
return array('twitter_get_tokens' => 'Twitter');
}
function twitter_get_tokens($uid, $site_id) {
return db_fetch_array(db_query("SELECT oauth_token, oauth_token_secret FROM {twitter_account} WHERE uid = %d", $uid));
}
?>Read more
You can find more articles about this module on my site.
Downloads
Recommended releases
Development releases
Project Information
- Maintenance status: Seeking co-maintainer(s)
- Development status: Maintenance fixes only
- Module categories: Content, Import/Export, Third-party Integration
- Reported installs: 44 sites currently report using this module. View usage statistics.
- Downloads: 1,231
- Last modified: December 10, 2011