freecodecamp / 100daysofcode-twitter-bot Goto Github PK
View Code? Open in Web Editor NEWTwitter bot for #100DaysOfCode
Home Page: https://twitter.com/_100DaysOfCode
License: BSD 3-Clause "New" or "Revised" License
Twitter bot for #100DaysOfCode
Home Page: https://twitter.com/_100DaysOfCode
License: BSD 3-Clause "New" or "Revised" License
I am opening this issue to block Twitter accounts who spam #100DaysOfCode and are retweeted by the bot. Please list Twitter handlers here and will update the list in production either weekly or bi-weekly basis.
What if we had something to where the bot would encourage someone to continue their 100DaysofCode? Maybe if they haven't posted in 7+ days and haven't posted Day 100 they would get a tweet mention that encouraged them to keep on going??
Consider adding SuperCoderBot
@heroes_bot to the user blacklist
Maybe add blacklisted usernames to the config.js
files like in the example done for the twitter bot bootstrap
Give #100DaysOfCode community members the option to opt out of receiving tweets from the bot.
They could just block the bot or mute it if they prefer but I think this will be a nice way to let users know that we're thinking of them and they can still follow the bot and see its posts in their stream so then be able to encourage other community members without getting tweeted at by the bot.
opt out reply 'something' to stop the bot
Something to that effect, this will have to go into a persistent datastore LevelDB
is probably the best option.
to avoid this:
====================
TWEET COUNTER=100
====================
====================
TWEET COUNTER=100
====================
====================
TWEET COUNTER=100
====================
====================
TWEET COUNTER=100
====================
====================
TWEET COUNTER=100
====================
These parameters need to be tested ๐
100DaysOfCode-twitter-bot/src/bot.js
Line 80 in 7b1534c
Tweet in form of "#100DaysOfCode ......" is not retweeted
example, https://twitter.com/realslimshanky/status/816352899257102336
It is a suggestion of a project that one can develop on that day. It can be a simple things of a skill to develop through that 1 hour.
For replies from the bit suggest using in_reply_to_status_id:
in the reply, this will give the user a bit of context as to why the bot is tweeting them with an inspirational quote. Example here:
bot.post('statuses/update', {
status: '@ScottDevTweets I reply to you yes!',
in_reply_to_status_id: '860900406381211649'
}, (err, data, response) => {
if (err) {
console.log(err)
} else {
console.log(`${data.text} tweeted!`)
}
})
A modification on this will need o be added to the sentiment.js
module
Upgrade Node.js version to 6.11.1
to avoid vulnerabilities.
More information regarding this issue here.
to keep consistent use of npm
over all development modes and the introduction of package-lock.json
since npm@5
.
(Write your answer here.)
minor bug
(Write what you thought would happen.)
I thought i would go to the place i need to generate an api key but it leads to a 404 page.
(Write what happened. Please add screenshots.)
I got a 404 page when i clicked on the 2nd ul in the contributing sections setup section of the readme. The ul that states "Generate your Sentiment API key here."
Software | Version |
---|---|
node | |
npm | |
yarn (if you use Yarn) | |
Operating system |
(Write your steps here.)
click on the link in the setup section of the readme that states "Generate your Sentiment API key here."
Just a thought that the Twitter keys for this are regenerated and kept private so that someone with not the best intentions could post what they like?
As it stands anyone can take this code and post what they like to the @_100DaysOfCode account on Twitter
Add Prettier badge
Add in the Prettier badge in the readme:
Add this line below the license badge>
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
For the badge to look like this:
Label it as a good first issue and help wanted @amandeepmittal please
Also add in the Twitter follow intent button:
Adding the following HTML into the README.me
<p>
<a href="https://twitter.com/intent/follow?screen_name=_100DaysOfCode">
<img src="https://img.shields.io/twitter/follow/shields_io.svg?style=social"
alt="follow on Twitter"></a>
</p>
You will have a follow on Twitter badge:
Add Code of COnduct for the community profile of the project
Optimal README layout from Kent Dodds source:
I re-tweeted one user:
https://twitter.com/heyamberwilkie/status/818507978697506818
And the bot replied to me think that I am on my first day of streak
https://twitter.com/_100DaysOfCode/status/818512348080115713
And it kept up the conversation:
https://twitter.com/_100DaysOfCode/status/818512644994985984
Is there a way to promote use of the Slack channel via the bot?
Maybe have it as one of the automated tweets?
Here is the signup link: https://t.co/yEbhWEtFsv
I got this to deploy, however it's acting strange,
it's starting to build okay, but gives me an error
(node:116) UnhandledPromiseRejectionWarning: OpenError: IO error: /home/nowuser/src/src/helpers/blacklistUsersDb/LOCK: No such file or directory
at /home/nowuser/src/node_modules/levelup/lib/levelup.js:91:23
at /home/nowuser/src/node_modules/abstract-leveldown/abstract-leveldown.js:41:14
at /home/nowuser/src/node_modules/deferred-leveldown/deferred-leveldown.js:20:21
at /home/nowuser/src/node_modules/abstract-leveldown/abstract-leveldown.js:41:14
at /home/nowuser/src/node_modules/abstract-leveldown/abstract-leveldown.js:41:14
(node:116) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:116) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
No open port found. Make sure 'npm start' creates an HTTP server on a port (any).
More details: https://err.sh/now-cli/no-open-port-found
====================
TWEET COUNTER=100
====================
...
it seems to just loop with the tweet counter...
Any help would be appreciated!
Thanks!
I'm thinking that we could have this added to a Travis CI workflow but I'm not sure on how it works with Heroku
https://docs.travis-ci.com/user/deployment/heroku/
Anyone have other suggestions, like deploying as an immutable deployment to now
or surge
??
If the bot was to not use local storage via LevelDB then it could be turned into an immutable deployment with zeti's now.
@spences10 what do you think? A collection of emoticons with random tweets or one emoji for an individual tweet? ๐๐
On @kallaway request, will change the Slack Invitation Link back to the original link for 100DaysofCode Slack Channel since it is never expiring link.
So as I understand it, 100DoC bot is calling functions in two differing ways which seem the samey
setImmediate(checkIfFirstOrLastDay, 720000);
And
setInterval(favoriteTweet, 960000);
and I'm asking for clarification here just as much as agreement but, is there not one way we could agree to use just one for consistency?
and also I have no idea what 960000 and 720000 milliseconds are and have to go convert them
can we agree on the
setInterval(favoriteTweet, 1000 * 60 * howeverManayMinutes);
So anyone reading can quickly see how long the interval is?
Thanks.
It serves no purpose in the src
folder as it's the images for the README.md
would it not make more sense o have this in teh root directory @amandeepmittal?
API keys in config.js
again, I have submitted PR to use .env
require('dotenv')
so API keys can be ignored in future ๐
Added #53 for this
Maybe consider pushing some tags to make a release for this?
https://github.com/zeit/release#usage
I'm not sure if I make a release on my branch if it will be reflected on the fCC one
Add CONTRIBUTING for the community profile of the project
This is a great one and fitting for freeCodeCamp imo
The idea is to use giphy translate endpoint to tweet relevant gifs.
Adding a .github
folder to contain all the GitHub community files will help declutter the root of the project.
Files that can be added to the .github
folder:
CODE_OF_CONDUCT
CONTRIBUTING
LICENCE
PR_TEMPLETE
ISSUE_TEMPLATE
Incoming PR for this as well ๐
Thoughts on using bot.stream('statuses/filter'
in place of search?
So, in place of having:
setInterval(retweet, retweetFrequency)
Then the search function in the retweet
module and the parameter passed in with the search terms. Why not have all the search terms in a search parameter?
const trackStream = bot.stream('statuses/filter', {
track: trackWords
})
trackStream.on('tweet', retweet)
There would possibly need to be some form of filter so as not to RT absolutely everything that is tweeted, but with this method, we can track more than just 100DaysOfCode tag
Node is defaulted to 8 in now so maybe do away with this if deploying to now with next release?
"engines": {
"node": "~6.1.0",
"npm": "~.3.8.6"
},
I noticed that the Bot is twiting two time for the same person.
Using GraphCool to store the data the bot uses for things like:
I would like to add #301DaysOfCode to tweets so people following that track can join part of the larger FCC community.
Maybe this could be pulled from an API
Maybe the quotes.json
file could be made into an npm package?
Would be good for a first timer with reference to @amandeepmittal's stoic-api for reference?
Check relationship and if user has already been thanked for following the account
This should probably go into one of the database enhancements as the info needs to be persisted.
In the Medium article there's a call to arms where the user will tweet their commitment to the challenge:
I'm publicly committing to the 100DaysOfCode Challenge
The bot can reply with a welcome message, this is sort of an extension to the abandoned API:
This could be a quick win however by using stream.on('tweet'
and match the specific (or exact) phrase
Check the condition if it's Day 1
or Day 100
to decide whether its first day or last day.
Also check the condition and exclude Day 10
, no tweet should be sent on Day 10
.
The contributing.md needs to have some work done.
Can I suggest adding in how to make a PR
Maybe take details from one of @QuincyLarson's Medium articles from the guides app?
Or point to the fCC Guides app locations??
The current slack channel url has expired
This is a good first issue
Change it to 100xcode.slack.com
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.