-
Notifications
You must be signed in to change notification settings - Fork 34
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
"oz" is not being converted to "troy oz" in subreddit /r/Pmsforsale #79
Comments
I'd Like to work on this Issue. |
Hello @arpitbatra123, this issue is reserved for people who have never opened a PR to open source. It looks like you've made a PR before, which is awesome! But it means you are overqualified for this issue :( If you are so inclined, you can check out any of the other issues in this repo that are not tagged Another alternative is you can go ahead and fix the issue just for learning purposes, but your PR will not be accepted back into the main repo. |
Hello @cannawen I would love to work on this issue. |
Assigned to you, @namantw! Feel free to reach out if you get stuck and can't find a solution :) |
Hey, in step number 5 it says "Run npm install to download all of the required dependencies". Are there any dependencies other than mocha? |
Yes, there should be more dependencies than mocha. |
Okay, just found it. Thanks! |
What am I doing wrong? I am an absolute beginner when it comes to npm. |
Hey @namantw , sorry I didn't see your message earlier! I'm sorry, I forgot a step in the setup (MY BAD!). You need to move the sample_environment.yaml file into a new folder called "private" and rename it to environment.yaml. That fix looks good to me, but try to run the tests again to see if it passes :) |
Okay, thanks a lot for your help :) |
Awesome!!! Make a pull request, and I will review it :) |
One more thing should I keep the private/environment.yaml as it is or revert it back to the way it was? |
Oops... I should not have told you to "move" the sample_environment.yaml, I should have told you to copy and paste. I will clear up these instructions for the next time I open a "first timers only" issue ;) Can you revert "sample_environment.yaml" back to the way it was? |
Okay done! |
Fixed issue : "oz" is not being converted to "troy oz" in subreddit /r/Pmsforsale cannawen#79. Added a 'gi' flag in the specialSubredditsRegex in ./src/conversion_helper.js
Issue cannawen#79 fixed.
@cannawen I have made the pull request! But I do not know how to add myself in the 'credits'. Can you do that for me if the PR is merged. |
@namantw What have you tried so far? Can you send some screenshots if you are encountering errors? |
I have made the PR. The issue is fixed, but I could not add myself to the 'credits'. |
Have you tried running this line: |
Hmm, interesting, and this is after you have already run OK... I'm not sure what is going wrong there either, I can add you after your PR gets merged in ;) |
Thanks for your patience and support :) |
No, thank you for contributing ;) Oh, one more idea about the all-contributors thing: Can you check |
^ @namantw See, this issue was closed automatically once the PR was merged ;) Do you have any feedback on your experience? This is the first time I have created a "first timers only" issue, so there were a few hiccups:
Anything else I can do to improve the experience for future first-timers? |
My experience was awesome :D |
metric_units is a sassy reddit bot that finds imperial units, and replies with a metric conversion.
First timers only
This issue is reserved for anyone who has never made a pull request to Open Source Software. If you are not a first timer, we would still love your help! Please see our other open issues :)
Read our New to OSS guide for an overview of what to expect
IMPORTANT: Comment below if you would like to volunteer to fix this bug.
Recommended experience
if
statements, arrays, etc.)Time estimate
30-60 minutes
Background Information
So, you want to work on a Reddit bot that converts imperial units to metric units? Awesome! It's not an easy problem to solve though :( Imperial units are confusing!!
Take ounces, for example. When someone says "ounces" they usually mean regular ("avoirdupois") ounces (which is 28.3495 grams). But, they could also be referring to "troy" ounces (31.1035 grams). Troy ounces are most often used when dealing with precious metals, like gold or silver
The problem
The subreddit /r/Pmsforsale is all about precious metals. They may refer to something as "ounce", but what they really mean is "troy ounce"
So, when the bot finds itself in /r/Pmsforsale, we want it to find all mentions of "ounces" and replace them with "troy ounces". This should already be happening, but it is not! There is a bug in the code.
To replace "ounces" with "troy ounces", we must find them by using a thing called Regular Expressions (also known as a, "regex"). Regexes help us find strings that match a certain pattern. For example if we had a regex
a
and applied it to this string:ababcA
... it would find all of the lower case a's but ignore the other characters (b, c, and A).OPTIONAL: You can go through this tutorial to learn more about regexes
OK, we are ready to get started. Lets get our development environment set up!
If you run into any problems, try googling for a solution. If that doesn't work, reply to this issue with screenshots of the error and what steps you have already taken to try to solve the problem. We're happy to help :)
node --version
npm install
to download all of the required dependenciesnpm test
to run all of the tests. All green? Yay!./src/conversion_helper-test.js
in your favourite text editorit.skip
withit.only
. This will tell the program to only run this single test. While you're here, take a look at the test! Read it carefully, can you guess what it does?npm test
again./src/conversion_helper.js
and find where we declarespecialSubredditsRegex
OPTIONAL: Can you think of other ways to make the test pass? Post your ideas in your Pull Request description later on (step 18).
it.only
toit
to run all of the tests again.OPTIONAL: Don't forget to give yourself credit! Thank you for contributing to metric_units bot!
Step 20: YOUR CHANGE GETS MERGED AND RELEASED!! Party!!!
The text was updated successfully, but these errors were encountered: