Skip to content

Instantly share code, notes, and snippets.

@dariusk
dariusk / amazonlogin.js
Created November 14, 2012 14:39
Logging in to Amazon using PhantomJS
// phantomjs code to log in to Amazon
// based on the code from this Stackoverflow answer: http://stackoverflow.com/questions/9246438/how-to-submit-a-form-using-phantomjs
// I'm injecting jQuery so this assumes you have jquery in your project directory
var page = new WebPage(), testindex = 0, loadInProgress = false;
page.onConsoleMessage = function(msg) {
console.log(msg);
};
@kocisov
kocisov / index.js
Created April 22, 2017 09:23
emoteParserLUL
import parse from 'twitch-emoji';
import bttv from './bttv.json'; // https://api.betterttv.net/emotes
// it's a mess, just... don't... please... save us
function emoteParser (msg) {
let _msg = msg;
msg.split(/\s+/).map(t => {
bttv.emotes.filter(emote => t === emote.regex).map(e => {
if (e.url && e.url.length > 0) {