musically-ut / first-timers-only-bot

â‘  First timers only issue tweeting bot.
https://twitter.com/first_tmrs_only
BSD 3-Clause "New" or "Revised" License
52 stars 23 forks source link

add language hash tag in the tweet #5

Open cg-cnu opened 7 years ago

cg-cnu commented 7 years ago

@musically-ut Hello! Had my first few PRs because of the awesome bot! Thanks for your work 💯 Didn't wanted to hijack the issue @hiimbex mentioned in #4 So, created a new one. While we are at #4, is it possible to add the language hash tag as well ? We need to query the primary 2/3 languages on the repo and add it as hash tag to tweet body.

cg-cnu commented 7 years ago

Github provides the api to query language of the repo. https://developer.github.com/v3/repos/#list-languages I think I can pickup and work on it. Let me know if that's ok :)

musically-ut commented 7 years ago

I'm very happy to know that this bot got you interested in OSS. 🎉

I remember the language tag being slightly tricker to get right while caching values and respecting the rate limits. I think it's a great feature even if it ends up crowding out the issue text a bit more. However, with Twitter providing context boxes with the tweets almost on all platforms, that shouldn't be a major issue.

If you want to, please go for it; I'll guide you along the way. :-)

cg-cnu commented 7 years ago

Thanks for the assignment. We can get the languages of the repo using https://api.github.com/repos/musically-ut/first-timers-only-bot/languages I already implemented that but the return value is a little verbose

{
  "Python": 7227,
  "Shell": 119
}

To make sure we are in the text count limit we need to improve the language hash tags. #js for Javascript and #py for Python so on...

Here is the approach am thinking of... I will get all the languages supported by github and added them to a json. We need to create the standard hash tag for each of the language, which is not humanely possible for me to edit for all the languages. Right now I will added for a couple of the most popular ones. Rest I just copied the name itself. Slowly we can keep improving it...

Q1: So, once I get python as the primary language(the language with high byte count given by github) I will query the tag for it py and add it to the list of hash tags. Is that OK ?

Q2: Do you think we should add two primary languages or just stick to one ?

Q3: Do you think we need #github tag ?

Let me know if you have any better suggestion. Feel free to correct me and point me in the right direction.

musically-ut commented 7 years ago

Getting all languages in a JSON file sounds good.

It doesn't have to be exhaustive either: we don't need to include very arcane abbreviations in the JSON; in case the language is not very commonly known, we can just not add a language tag.

I'd just stick to one tag: the only cases this may be misleading is if build-files are included in the repository (i.e. mostly for languages which compile down to Javascript). I think even tagging the target language in that case will be alright.

As for the #github tag: we can get rid of it; I don't think I'll be adding support for BitBucket anytime soon. :)

kgashok commented 2 years ago

@musically-ut, @cg-cnu Is this issue still open? And open for contribution?

musically-ut commented 2 years ago

@kgashok yes! Would you like to work on it?