pgte / nodetuts_26

Node Tuts episode 26
17 stars 2 forks source link

Docs Everyauth #2

Open alexgenovese opened 12 years ago

alexgenovese commented 12 years ago

Hello,

did you know a doc where I can find documentation related how to send and get info from facebook, twitter accounts using everyauth module?

Thanks in advance!

Alex

pgte commented 12 years ago

The module instructions should get you going there:

https://github.com/bnoguchi/everyauth

Cheers,

-Pedro

On Thu, Feb 23, 2012 at 11:41 AM, Alex Genovese < reply@reply.github.com

wrote:

Hello,

did you know a doc where I can find documentation related how to send and get info from facebook, twitter accounts using everyauth module?

Thanks in advance!

Alex


Reply to this email directly or view it on GitHub: https://github.com/pgte/nodetuts_26/issues/2

-Pedro

alexgenovese commented 12 years ago

I have seen but I can't find a simple example to get info or to post something on the facebook /twitter status. Can you help me pls ?

pgte commented 12 years ago

ah, you'd have to use the Twitter or Facebook APIs for that.

You can start here for twitter: https://dev.twitter.com/ And facebook: http://developers.facebook.com/

On Thu, Feb 23, 2012 at 1:22 PM, Alex Genovese < reply@reply.github.com

wrote:

I have seen but I can't find a simple example to get info or to post something on the facebook /twitter status. Can you help me pls ?


Reply to this email directly or view it on GitHub: https://github.com/pgte/nodetuts_26/issues/2#issuecomment-4136099

-Pedro

alexgenovese commented 12 years ago

XD I usually use that libraries with other frameworks but I'm trying to work with everyauth and I don't know how to send a post. For example I have tryed to get the stream status on facebook and it works:

everyauth.facebook
  .appId(conf.fb.appId)
  .appSecret(conf.fb.appSecret)
  .findOrCreateUser( function (session, accessToken, accessTokExtra, fbUserMetadata) {
      return usersByFbId[fbUserMetadata.id] || (usersByFbId[fbUserMetadata.id] = addUser('facebook', fbUserMetadata));
  })
//  .scope( 'email,user_status, pusblish_stream')
  .fetchOAuthUser( function (accessToken) {
    var p = this.Promise();

    this.oauth.get(this.apiHost() + '/me', accessToken, function (err, data) {
      if (err)
        return p.fail(err);
      var oauthUser = JSON.parse(data);
      p.fulfill(oauthUser);
    })

... 

I'm searching but I don't find nothing of useful on github.. I also try this code:


everyauth.facebook
  .appId(conf.fb.appId)
  .appSecret(conf.fb.appSecret)
  .findOrCreateUser( function (session, accessToken, accessTokExtra, fbUserMetadata) {
      return usersByFbId[fbUserMetadata.id] || (usersByFbId[fbUserMetadata.id] = addUser('facebook', fbUserMetadata));
  })
  .fetchOAuthUser( function (accessToken) {
    var p = this.Promise();
     this.oauth.post(this.apiHost() + '/me/feed', accessToken, {message: 'Ciao'}, function (err, data) {
      if (err)
        return p.fail(err);
      var oauthUser = JSON.parse(data);
      p.fulfill(oauthUser);
    })

.. but I get an error about this.oauth.post that doesn't exists..