Skip to content

Instantly share code, notes, and snippets.

@nsfyn55
nsfyn55 / media-bias-scrubbed-results.csv
Last active May 22, 2024 06:24
A fully scrubbed CSV of all of media bias fact check's primary categories(note on bias negative(-) connotes liberal bias, positive(+) connotes conservative bias)
site_name url bias_rating factual_reporting_rating
(The) Interpreter Magazine http://www.interpretermag.com/ -8 HIGH
1600 Daily https://www.whitehouse.gov/1600daily 26 MIXED
2ndVote https://2ndvote.com/ 29 MIXED
680 News http://www.680news.com/ -3 HIGH
71 Republic https://71republic.com/ 15 HIGH
9 News (Australia) http://www.9news.com.au/ 6 HIGH
ABC News Australia http://www.abc.net.au/news/ -4 HIGH
ABC News http://abcnews.go.com/ -13 HIGH
ABC11 Eyewitness News http://abc11.com/ -11 HIGH
@nsfyn55
nsfyn55 / media-bias-rankings.csv
Last active November 15, 2018 19:55
Media Bias Fact Check's images converted to a discrete number line
bias_png numeric_ranking
extremeleft01 -35
extremeleft02 -34
extremeleft03 -33
extremeleft04 -32
extremeleft05 -31
extremeleft06 -30
left1 -29
left2 -28
left3 -27
@nsfyn55
nsfyn55 / scrape-media-bias.py
Created November 10, 2018 22:44
Scraps over all of media bias's links and outputs a csv
import requests
import re
from bs4 import BeautifulSoup
import time
def parse_page(link):
resp = requests.get(link)
if resp.status_code == 404:
@nsfyn55
nsfyn55 / media-bias-fc-scrape.csv
Last active November 15, 2018 19:33
A raw CSV scrape of Media Bias Fact Check
site_name url bias_png factual_reporting
Act.TV http://act.tv left4 HIGH
Addicting Info http://addictinginfo.com left5 MIXED
Advocate http://www.advocate.com/ left8 HIGH
Akkadian Times http://akkadiantimes.com left8 HIGH
Alliance for Justice (AFJ) https://www.afj.org/ left8 HIGH
All That’s Fab http://www.allthatsfab.com/ left2 MIXED
AlterNet http://www.alternet.org/ left2 MIXED
Amandla http://aidc.org.za/amandla-media/ left7 HIGH
AmericaBlog http://americablog.com/ left7 HIGH
9ooxuf,senate will not vote on new north america trade pact in 2018 mcconnell,1,0,reuters.com,2018-10-16T11:58:33,Eurynom0s,757318,755598,2941
9ooxnb,the uncertain fate of affirmative action,1,0,newrepublic.com,2018-10-16T11:58:01,_basquiat,365654,35358,465
9ooxdy,dozens of immigrant children remain detained as administration prepares for more family separations,2,0,thinkprogress.org,2018-10-16T11:57:11,Hoxha_Posadist,145078,32668,78
9ooxbi,trump calls stormy daniels horseface in gloating twitter post,0,0,nytimes.com,2018-10-16T11:56:59,EmoLibrarian,111728,4437,381
9ooxae,after a year of metoo american opinion has shifted against victims survey respondents have become more sceptical about sexual harassment,0,0,economist.com,2018-10-16T11:56:53
,lawblogz,50865,-100,2195
9oox5e,president trump denies financial ties to saudi arabia despite long history of links ny daily news,6,0,nydailynews.com,2018-10-16T11:56:26,Tech1Tv,4584,-13,556
9oowy3,lindsey graham jokes about taking dna test ill probably be iranian tha
@nsfyn55
nsfyn55 / highlightrows.gs
Last active February 28, 2018 17:53
Highlight Rows Based on Column in Google Sheets
function onEdit(e){
// Set a comment on the edited cell to indicate when it was changed.
var sheet = SpreadsheetApp.getActiveSheet();
statusColumn = 4;
if (sheet.getActiveCell().getColumn() == statusColumn) {
cell = sheet.getActiveCell();
column = cell.getColumn();
var row = sheet.getActiveRange().getRow();
var cellValue = cell.getValue();
@nsfyn55
nsfyn55 / find.py
Created October 26, 2017 22:21
Find the closest integer in a list
def find_closest(t, vs):
vs.sort()
smallerest = None
for v in vs:
if not smallerest or (v < t and v > smallerest):
smallerest = v
vs.sort(reverse=True)
biggerest = None
for v in vs:
@nsfyn55
nsfyn55 / histovert.c
Created October 26, 2017 18:26
Kernighan and Richie's Vertical Word Histogram Example
#include <stdio.h>
#define IN 1 /* we're inside a word */
#define OUT 0 /* we're outside a word */
#define SPACE 8 /* we're outside a word */
#define PSPREV 0
#define PSNULL 1
int main(){
@nsfyn55
nsfyn55 / prob.py
Created June 16, 2015 20:36
Project Euler Problem 1
"""
if we list all the natural numbers below 10 that are multiples of 3 or 5, we get
3, 5, 6 and 9. The sum of these multiples is 23.
"""
cap = 1000
total = 0
for i in range(1,cap):
@nsfyn55
nsfyn55 / curry.py
Created June 7, 2015 15:51
Currying Example
def add(x, y):
return x + y
def add_curried(x):
def partial(y):
return x + y
return partial
print add(3,4)