Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 09 2015 08:02
    johnny5550822 opened #4
  • Feb 05 2015 16:21
    jcreamer898 opened #3
  • Aug 31 2014 16:38
    wernull commented #2
  • Aug 31 2014 04:28

    jcreamer898 on list

    (compare)

  • Aug 31 2014 04:27

    jcreamer898 on v0.3.0

    (compare)

  • Aug 31 2014 04:27

    jcreamer898 on list

    (compare)

  • Aug 31 2014 04:26

    jcreamer898 on master

    Add in docs for post/put (compare)

  • Aug 31 2014 04:17
    jcreamer898 commented #2
  • Aug 31 2014 04:17
    jcreamer898 closed #2
  • Aug 31 2014 04:17

    jcreamer898 on master

    allow PUT as api option some y… Merge pull request #2 from wern… (compare)

  • Aug 31 2014 04:17
    jcreamer898 reopened #2
  • Aug 31 2014 04:15
    jcreamer898 closed #2
  • Aug 31 2014 04:15
    jcreamer898 commented #2
  • Aug 31 2014 04:13
    jcreamer898 commented #2
  • Aug 30 2014 18:53
    wernull opened #2
  • Aug 29 2014 21:48
    jcreamer898 commented #1
  • Aug 29 2014 21:47
    jcreamer898 closed #1
  • Aug 29 2014 21:47

    jcreamer898 on master

    remove extra forward slash in c… Merge pull request #1 from wern… (compare)

  • Aug 27 2014 03:23
    wernull opened #1
Freddie Carthy
@gjunkie
Hi there
Its super late. just saw your tweet. but thanks for the reply!
I got it up and running pretty quick actually. I've been wanting to make an MLB fantasy app for a while, but the authentication has always been a pain. I was amazed at how quick I was up and running
My main question right now is, I'm fairly new at Node, and the majority of my exposure has been using the Hapi framework. I started trying to implement your lib into my hapi project, but I'm not doing so well. Hitting the /auth/oauth URL throws this error: Cannot set property 'oauthToken' of undefined
Freddie Carthy
@gjunkie
What Ive noticed is that req/res in every-day node != request/reply returned by the hapi handler.
Been scratching my head at what to pass in to: FantasySports.startAuth(req, res); and endAuth.
Freddie Carthy
@gjunkie
Not sure how familiar you are with Hapi... hopefully plenty :) but anyway, thanks for this awesome lib. Can't wait to get crazy with it. I'm gonna head to bed, but i'll leave this chat window open and check back in tomorrow. Thanks!!
Freddie Carthy
@gjunkie
@jcreamer898 im back!
Freddie Carthy
@gjunkie
I think if I could figure out what props these things are expecting from req/res, it shouldn't be that hard to switch it over.
Jonathan Creamer
@jcreamer898
Ah, this framework is designed to work with Express.js actually, however you should be able to re-tool the code that I wrote to work with what you're doing... Have a look at this... https://github.com/jcreamer898/fantasy-sports/blob/master/lib/framework/auth.js
That's how I did authentication.
Freddie Carthy
@gjunkie
@jcreamer898 hi again! so I've been building my own solution. I'm using the oauth module and am hitting the API successfully. But I have a nagging issue that I'm wondering if you ever experienced. It seems that i randomly get a "consumer_key_unknown" error. This could be at the login stage, or retrieving data. I refresh the page, and everything is fine. Seems completely random.
Freddie Carthy
@gjunkie
@jcreamer898 also, taking a look at how you did auth, i see that you forked that oauth module and added a new refreshOAuthAccessToken method. Trying to use your fork, but getting a token_rejected error when trying to use it. Any pointers you can give me on that method?
Freddie Carthy
@gjunkie
sorry to bombard you with questions.. just seems like Yahoo has no interest in responding, and you're the only one i've found working on the same level here...
Jonathan Creamer
@jcreamer898
Haha, yeah they are teh suck
Do you have your source online anywhere?
Also, on the refresh method, make sure you're passing your OLD oauthAccessToken, oauthAccessSecret, and oauthSessionHandle
Freddie Carthy
@gjunkie
I'd love for you to take a look. I'll make you a colab on my repo and pass you a few files/line numbers. The problem might be that I'm using Hapi.js' bell module, and I don't think it exposes the access token, unless I'm mistaken.. I think it gives me the regular token.. the one that starts with A=ds038Ablahblahblah
Steve Paulo
@stevepaulo
Hello. I'm on a commuter bus right now so i may not be very helpful. Do you have any idea what might be going on?
I'm also considering ditching an in-code solution in favor of OAuth.io. Going to try it, anyway.
Jonathan Creamer
@jcreamer898
Nice. OAuth is hard, and Yahoo is using a super old version of it.
I'm digging into your code ATM
Steve Paulo
@stevepaulo
Yeah I'd never bother with Yahoo if I just needed user auth, but I'm building a companion app to my fantasy football league.
Jonathan Creamer
@jcreamer898
Awesome, that's why I build this thing!
Jonathan Creamer
@jcreamer898
Ok, so @stevepaulo make sure you quadruple check that your oauthKey and oauthSecret are being set correctly.
What you can do to check this is...
Go to the node_module directory, and look for fantasysports/lib/framework/auth.js
And add some logging in there...
Auth.prototype.beginAuthentication = function(req, res) {
    var oa = this.getOAuth();

    console.log(oa);

    oa.getOAuthRequestToken(function(error, oauth_token, oauth_token_secret) {
        console.log(arguments);

        req.session.oauthToken = oauth_token;
        req.session.oauthTokenSecret = oauth_token_secret;

        // TODO: move to some config
        res.redirect("https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=" + oauth_token);
    });
};
The oa you should see _consumerKey: "your token".
Steve Paulo
@stevepaulo
I'll try that.
Jonathan Creamer
@jcreamer898
So, make sure that's good, then also, check and see if there's an error in the console.log(arguments);
I need to put some better error logging in there.
Steve Paulo
@stevepaulo
Cool, I'll be able to try this in an hour or so. Thanks for your help pointing me in the right direction.
Jonathan Creamer
@jcreamer898
You bet. Hopefully we'll get it working for ya!
Steve Paulo
@stevepaulo
ok, the oa object has my key, but the arguments object is a big 401 error. looks like the message is "ustom port is not allowed or the host is not registered with this consumer key."
Jonathan Creamer
@jcreamer898
Ahhh, that sounds like a config error with Yahoo, so it's a bit weird the way this has to work.
I see you're using Heroku?
You'll need to tell Yahoo that your redirect_url is like "http://yoursite.herokuapps.com/auth/callback",
And in your config in server.js, make that be your redirect url as well.
Then what'll happen is, you'll get sent to Yahoo, it'll redirect to your herokuapps url with a token in the URL, then you can simply at that point replace it with localhost:8000, and your local app will pick back up.
That makes sense?
Steve Paulo
@stevepaulo
yeah i think so. crappy that yahoo goes out of its way to keep devs from using localhost at all
Jonathan Creamer
@jcreamer898
yup
Steve Paulo
@stevepaulo
thanks for your help
Jonathan Creamer
@jcreamer898
Took me for damn ever to figure that part out...
you bet!
danrap
@danrap
@jcreamer898 Hi, I am javascript newb, and I was wondering if you have an express implementation that can pull the data using a yql query : https://query.yahooapis.com/v1/yql?q=select%20*%20%0Afrom%20fantasysports.leagues.standings%20%0Awhere%20league_key%3D'nfl.l.750201'%0A&format=json&diagnostics=true
I am having trouble understanding the pieces needed to run your module. Do you have an example I can modify. I ran express to create the tree of directories and boilerplate code, by I don't know how to modify the code per your README instructions.