Still very much a WIP but it gets the job done.
pip install -r requirements.txt
- Replace
WATCH_URL
andBASE_URL
inscraper.py
python3 scraper.py output_file
[ | |
{"author": "Pete Hunt", "text":"This is one comment"}, | |
{"author": "Jordan Walke", "text": "This is another comment"}, | |
{"author": "Elon Musk", "text": "SPAAAAAAAAAACE"} | |
] |
var fs = require('fs'); | |
var data = fs.readFileSync('listofnames.txt','utf8').toString().split("\n"); | |
var mainset = []; //Random group of 60 students | |
var subsetOne = []; //Random group of a subset of 30 / 60 students | |
var subsetTwo = []; //Random group of a subset of 30 / 60 students | |
var indicesSetOne = []; | |
var indicesSetTwo = []; | |
var indicesSetThree = []; | |
//Random function with arg max number |
(define (leftpad s l c) | |
(if (number? s) | |
(set! s (number->string s)) | |
) | |
(if (number? c) | |
(set! c (number->string c)) | |
) | |
(define (_leftpad _s _l _c) | |
(if (<= _l 0) | |
_s |
function CheatCode(){ | |
this._lettersPressed = []; | |
this._registeredWords = []; | |
var _getLastN = function(n, a){ | |
var r = []; | |
for(var i=0; i<n; i++){ | |
r.push(a[a.length - i -1]) | |
} | |
return r.reverse(); |
class User < ApplicationRecord | |
def self.find_or_create_from_auth_hash(auth) | |
where(provider: auth.provider, uid: auth.uid).first_or_initialize.tap do |user| | |
user.provider = auth.provider | |
user.uid = auth.uid | |
user.first_name = auth.info.first_name | |
user.last_name = auth.info.last_name | |
user.email = auth.info.email | |
user.picture = auth.info.image | |
user.save! |
class SessionsController < ApplicationController | |
def create | |
@user = User.find_or_create_from_auth_hash(env["omniauth.auth"]) | |
session[:user_id] = @user.id | |
redirect_to :me | |
end | |
def destroy | |
session[:user_id] = nil |
Rails.application.routes.draw do | |
get 'login', to: redirect('/auth/google_oauth2'), as: 'login' | |
get 'logout', to: 'sessions#destroy', as: 'logout' | |
get 'auth/:provider/callback', to: 'sessions#create' | |
get 'auth/failure', to: redirect('/') | |
get 'home', to: 'home#show' | |
get 'me', to: 'me#show', as: 'me' | |
root to: "home#show" |
Rails.application.config.middleware.use OmniAuth::Builder do | |
provider :google_oauth2, "GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET" | |
end |
class HomeController < ApplicationController | |
def show | |
end | |
end |