Skip to content

Instantly share code, notes, and snippets.

View joshhills's full-sized avatar
👋
Open to reviewing portfolios - especially if you're in a marginalised group

Josh Hills joshhills

👋
Open to reviewing portfolios - especially if you're in a marginalised group
View GitHub Profile
@joshhills
joshhills / Sally.yarn
Created January 8, 2020 16:16
Sally example Yarn Spinner dialogue with shortcut options
title: Sally
tags:
colorID: 0
position: 524,111
---
Sally: Test #line:017eb50
-> No, thanks. #line:078a32c
Sally: Aw, ok! #line:0af877c
-> I'm good. #line:07aa873
@joshhills
joshhills / superfanreviews-worker.js
Created November 21, 2019 00:14
Super Fan Reviews Worker Script
const Twitter = require('twitter');
const config = require('./config.js');
const database = require('./firebase.js');
const censor = new (require('censor-sensor').CensorSensor)();
const axios = require('axios');
// Allow common profanity.
censor.disableTier(2);
// Initialise Twitter client.
@joshhills
joshhills / superfanreviews-scraper.js
Last active November 21, 2019 00:13
Super Fan Reviews Scraper Methods
const TWITTER_CHARACTER_LIMIT = 280; // The bottleneck
const MIN_REVIEW_SIZE = 10; // Minimum amount of characters acceptable to be interesting
const TEXT_PADDING = 25; // How much spacing is in the post template to be safe
const AVERAGE_PLAYTIME_THRESHOLD = 10; // Multiplier for necessary time played to consider
const MIN_AVERAGE_FOREVER = 120; // Only choose games that have some activity in the past couple of weeks
const MIN_NEGATIVE_REVIEWS = 100; // Only choose games that have had some reviews
const alreadyScrapedGames = await database.ref('games/').once('value').then(function(snapshot) {
return Object.keys(snapshot.val());