Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the lib/habit-rpg.js file to use the Habitica API v3 #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nickrfer
Copy link

@nickrfer nickrfer commented Jul 7, 2016

For this pull request I have updated the lib/habit-rpg.js file to use the Habitica API v3, therefore fixing the Bad Gateway 502 error (#1).

I have deployed this version at heroku. A sample use would be the following, as a webhook to a repository:
http://githabitnickrfer.herokuapp.com/githabit?api=habiticaApi&user=habiticaUser

Please validate, thanks!

// Creates the score task rest api parameters.
function getApiScoreParameters(apiOptions) {
var parsedApiScorePath = apiScorePath.replace("name",
apiOptions.name).replace("dir", apiOptions.dir);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a bit of a risk if the task name has dir in it, right?

@nickrfer
Copy link
Author

nickrfer commented Jul 7, 2016

I agree @Kerrick, I will provide a fix for this tonight. Thanks for the feedback.

…unction in the lib/habit-rpg.js file. This has been done in order to format the dir and taskName into to the apiScorePath variable.
@nickrfer
Copy link
Author

nickrfer commented Jul 7, 2016

@Kerrick, I changed the code to use the nodejs 'util' module, in order to avoid the risk that was associated with my previous commit. Please validate, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants