Skip to content

Instantly share code, notes, and snippets.

View m-r-m-s's full-sized avatar
🔈

mrms m-r-m-s

🔈
View GitHub Profile
@danthareja
danthareja / promises.js
Last active July 25, 2023 03:05
A conjurer's guide to promises
/*
* A quick example of how to use Bluebird and Q to conjure your own promises
*
* Everything going on here is explained further in the following video:
* http://youtu.be/OU7WuVGSuZw?list=PLT-DLWOBKbB4dZ83I_7Ca-sUTvorckG-E
*
*/
// Import node modules
var Q = require('q');
@aparrish
aparrish / twitterbot.md
Last active May 23, 2022 01:03
Make-A-Twitter-Bot Workshop
@dotcomputercraft
dotcomputercraft / gist:b7283bd52f4b5389e748
Last active June 29, 2024 18:52
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
the best way (I've found) to completely uninstall node + npm is to do the following:
go to /usr/local/lib and delete any node and node_modules
go to /usr/local/include and delete any node and node_modules directory
if you installed with brew install node, then run brew uninstall node in your terminal
check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
go to /usr/local/bin and delete any node executable
You may need to do the additional instructions as well:
sudo rm /usr/local/bin/npm
@shiffman
shiffman / recordinglist.md
Last active September 13, 2019 15:53
A list of ideas for #CodingRainbow Video topics: https://www.youtube.com/user/shiffman
@debashisbarman
debashisbarman / README.md
Last active February 15, 2024 02:19
A boilerplate Twitter bot that can retweet in response to the tweets matching particluar keyword (https://goo.gl/4whEIt)

Creating a Twitter bot with Node.js

Learn how you can create your own Twitter bot using Node.js and the new Twitter API. The bot will auto retweet in response to tweets with some particular hashtags. (https://goo.gl/4whEIt)

Tools we need

Here are the tools we’ll be using to create the bot — 

  • Node.js installed in your machine
  • A registered Twitter account

Create a Twitter application

@airhadoken
airhadoken / twittercard.js
Last active February 4, 2022 18:41
Making twitter cards and also getting data back from them later, in NodeJS.
var T = require("twit");
var Q = require("q");
// key and secret for Twitter for iPhone.
// A whitelisted app is needed to access the cards API; you can't just create your own currently.
var TWITTER_CONSUMER_KEY = "IQKbtAYlXLripLGPWd0HUA";
var TWITTER_CONSUMER_SECRET = "GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU";
// These you will have to fill in yourself by authorizing Twitter for iPhone for your account.
// How to get the access tokens through OOB authorization is outside the scope of this snippet.
var TWITTER_ACCESS_TOKEN = "";
@desflynn
desflynn / streamTweetsIreland.js
Created February 29, 2016 13:58
Saves a stream of tweets from Ireland to a text file
var Twit = require('twit')
var moment = require('moment');
var fs = require('fs');
var T = new Twit({
consumer_key: '...',
consumer_secret: '...',
access_token: '...',
access_token_secret: '...',
timeout_ms: 60*1000, // optional HTTP request timeout to apply to all requests.

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express
@jimkang
jimkang / post-image.js
Created May 3, 2016 15:23
One way to post an image to Twitter, starting with an imageURL
var request = require('request');
var async = require('async');
// TODO: This could be in its own package.
function postImage(opts, allDone) {
var twit;
var dryRun;
var imgurl;
var altText;
var caption;
@edsu
edsu / tweet-ids.py
Last active January 27, 2017 20:51
Archive a Twitter search result using webrecorder.io, download the WARC file, and then extract the tweet identifiers with this script.
#!/usr/bin/env python
"""
If you use webrecorder.io to archive a Twitter search result and then download
the WARC file you can use this script to read through the WARC file looking
for tweet identifiers to hydrate.
You'll need to install the [warc] module for the script to work. After that you should be able to:
./tweet-ids.py file.warc.gz > ids.txt