Hi Karim,
Have you checked out oauth_common (http://drupal.org/project/oauth_common)? You should be able to use it to replace the PECL dependency quite cleanly. There's also http_client (http://drupal.org/project/http_client) which has support for making request for resources protected by OAuth.

Cheers,
Hugo

Comments

infojunkie’s picture

Thanks Hugo, I was considering using the OAuth library but I'll check your modules which seem comprehensive.

BenK’s picture

Interesting module... looking forward to testing.

infojunkie’s picture

Title: OAuth Common and Http Client » Integrate with OAuth Common and Http Client
Category: task » feature
voxpelli’s picture

Subscribing

infojunkie’s picture

@voxpelli: Can you please explain why you are interested in integrating Feeds OAuth with OAuth.module? Is it just to get rid of dependency on PECL OAuth library or is there another use case?

voxpelli’s picture

@infojunkie: As a co-maintainer of the OAuth module I'm interested in having other people use it more and contribute to it more so that we can ensure that it is as solid and useful as possible for as many Drupal modules as possible.

You shouldn't need to use PECL OAuth and any users who has already installed OAuth shouldn't need to install yet another library.

Regarding HTTP Client, which I also co-maintain, I'm not that sure you would benefit as much from that since one of the features of it is the parsing of responses, which I assume is something that other parts of Feeds is taking care of.

StevenWill’s picture

There does not seem to me a oauth_common version for drupal 7.

edit: never mind, the oauth_common project is now at oauth.

jlyon’s picture

I just wrote a sandbox module that integrates with oauthconnector, which integrates with oauth: http://drupal.org/sandbox/jlyon/1481562. I was able to build a feed with feeds_jsonpath_parser that imports events from Facebook.

I created it as a separate module because it is extremely basic and a lot of the logic in oauth_feeds replicates the logic in oauthconnector. I would be happy to work on integrating it with oauth_feeds if you would like to go down that route as well.

Here's the readme:

Feeds OAuth Connector Fetcher
Fetches data from OAuth services for aggregation in Feeds.

Dependencies:
oauth
oauthconnector
feeds
http_client

Other Recommended Modules
feeds_jsonpath_parser

-----------------------------
INSTALLATION
-----------------------------
Enable the module from Administer -> Modules as usual.
Create a new Feed
Select the OAuth Connector Fetcher

-----------------------------
EXAMPLE USE-CASE
Creating Pages with your Facebook Feed updates
-----------------------------

Modules
  oauth
    oauth_common
    oauth_common_providerui
  oauthconnector
  feeds
  http_client
  feeds_jsonpath_parser
  
Enable all modules
Go to /admin/structure/oauthconnector/list, click Add Provider from Preset, and choose Facebook
  Go to https://developers.facebook.com/apps and create a Facebook App
    Enter your site's URL in App Domain
    Check the Website row and enter your site's URL
  Copy App ID and App Secret keys into the OAuth Consumer Key and OAuth Consumer Secret fields
  Under OAUTH CONSUMER ADVANCED SETTINGS, add "read_stream" to the end of the Scope field.
    This will give us the proper Facebook permissions
Go to /user and click on the Connections tab
Click on the Facebook button and go through the connection process
Create a new Feeds Importer at /admin/structure/feeds/create
  Select the OAuth Connector fetcher
  Select the Feeds JSONpath parser
  Under Mapping, select JSONpath as the source and your target field
  Click on the Parser settings, and enter the JSONpath Context and path to each field
    For example: Context = $.data.*, Title = path
Go to /import and select your importer
  Enter https://graph.facebook.com/me/home as the Endpoint
  Select Facebook as the provider and import your nodes

I have found that Facebook's excellent Graph API Explorer (http://developers.facebook.com/tools/explorer)
is the best way to browse their api.

infojunkie’s picture

Status: Active » Closed (won't fix)