digital cut-up: james baldwin and white supremacist twitter bios

this is a very simple flask app that pairs lines from two corpuses: white supremacist richard spencer’s twitter followers’ twitter bios and an essay by james baldwin, “letter from a region in my mind”

i was working with the twitter bios earlier in the semester when i made an executive order generator. here were some sample bios:

PC Gamer. Social Democrat. Egalitarian. Admin at @TheDPWiki. I revel in your butthurt.

Biblical Christian and anti-corporate Libertarian. Jesus is my Good Shepard not the State or Allstate and we are definitely in the last days.

FutureDanger is an American news link Heatmap Dashboard. Achieve situational awareness of multiple threat indicators in one view. Be prepared. ΜΟΛΩΝ ΛΑΒΕ

The Donald and #MAGA to save The Merica. Kek Meme generation and Ody cat integration.

i was struck by them: their rhythm, the way they reference an in-group with a shared vocabulary, the way they express ideology in buzzwords. the content of them is interesting, too: common themes are, predictably, whiteness, americanness, christianness, a certain kind of masculinity. they are provocative in predictable ways.

initially, i was going to generate new bios with a markov chain. markov chain projects, as allison helped me understand, highlight the ridiculousness of a corpus. markov chains say, “these words make so little sense that a program that primarily calculates statistical probabilities can reasonably replicate them.” the effect is light, silly. these bios are ridiculous, but they’re not light and silly. i wanted to highlight something else about them.

james baldwin’s writing is the opposite of these bios. putting one of his sentences next to one of their sentences contextualizes both. why do the bios say so little? why in that meaningless way? what do they never say? never own? why are they so angry? what do their writers think has been stolen? baldwin tells us.

the code

first, i got spencer’s followers twitter bios: https://gist.github.com/kaganjd/9a00be3932a2485abca047bc6733146e

then, i looked at baldwin’s essay: https://gist.github.com/kaganjd/5e8c2120713ccb3cc737e81c18575c0b

then, i picked out the lines from each corpus that had the word ‘white’ and printed them together: https://gist.github.com/kaganjd/36c455e95502102b2d72fb36c25f1e05

finally, i used all that to write a server: https://github.com/kaganjd/whiteness/blob/master/server.py

By u’the darkness vested in me as President

the api is bad but twit is good!

all you need is an index.js file with this stuff in it:

some usage:

  • get tweet ids of the most recent 20 tweets from a given user name

  • get the most recent statuses that include the query

  • literally the most annoying way to get twitter bios of richard spencer’s followers

here’s a sampling of richard spencer’s followers’ twitter bios, after lots of cleanup:

PC Gamer. Social Democrat. Egalitarian. Admin at @TheDPWiki. I revel in your butthurt.

Biblical Christian and anti-corporate Libertarian. Jesus is my Good Shepard not the State or Allstate and we are definitely in the last days.

FutureDanger is an American news link Heatmap Dashboard. Achieve situational awareness of multiple threat indicators in one view. Be prepared. ΜΟΛΩΝ ΛΑΒΕ

The Donald and #MAGA to save The Merica. Kek Meme generation and Ody cat integration.

Official Twitter of the Aggie Helicopter Enthusiasts.\nLeading the struggle against Marxism at Texas A&M University

Vagabond

#TRUMPNATION

“But isn\t that the way it is? Every goddamn time. Your prayers are always answered in the order they\re received.”

^^ #FIFOprayers

tagged with this script:

…[Sentence(‘Altruism/NN/B-NP/O :/:/O/O Selfless/NNP/B-NP/O Self/NNP/I-NP/O Destructive/NNP/I-NP/O death/NN/I-NP/O Cult/NN/I-NP/O religion/NN/I-NP/O Philosophy/NN/I-NP/O and/CC/I-NP/O Language/NN/I-NP/O of/IN/B-PP/B-PNP Irrationalism/NN/B-NP/I-PNP Socialism/NN/I-NP/I-PNP Communism/NNP/I-NP/I-PNP Fascism/NNP/I-NP/I-PNP all/DT/I-NP/I-PNP Wars/NNP/I-NP/I-PNP ././O/O’), Sentence(‘AltTrue-ism/NN/B-NP/O =/SYM/O/O Lies/NN/B-NP/O’)]…

but my old script from last week worked fine too, as long as i erase emojis and other weird stuff. so through last week’s grammar.py script. 

cat bios-phraseGrep-clean.txt | python grammar.py > grammar4.txt

here’s my fav:

TASK FORCE ON u’everything software AND PUBLIC SAFETY By u’the darkness vested in me as President by the Constitution and the laws of the United States of America, and in order to reduce crime and restore public safety to communities across u’the solution, it is hereby ordered as follows: Section 1. Policy. It shall be u’the name of the executive branch to reduce crime in America. Many communities across the Nation are suffering from high rates of violent crime. u’the time on law and order and u’the truth and security of the American people requires u’the gallows to enforcing u’the state and developing policies that comprehensively address illegal immigration, u’no gf, and violent crime. The Department of Justice shall take u’the lamentation on Federal actions to support dog lover~runner efforts nationwide and to collaborate with State, tribal, and local jurisdictions to restore public safety to all of our communities.

okay, but this was all sooooo messy. things i need to improve next time:

  • workflow for bio responses through phraseGrep script! this time, i was copy/pasting the console.log of the bios, 100 at a time where each one looked ‘like this’, into a txt file—but when i looked at the file in the python interpreter, each line wasn’t registering as a line in an array. there was just a bunch of garbage punctuation to get rid of. bummer.
  • also, to keep this all python, i should tweepy (python) instead of twit (js). i wonder if i can get the same info with that?
  • sentence tagging! sometimes tagging words is better, sometimes keeping the sentences in tact is better.
  • also, how to get most frequently occurring POS tags?

the garden-path and security of the American people

i did a module! with functions! phraseGrep.py tags pattern phrases and puts each phrase into its pattern’s array. then, grammar.py imports those arrays and uses them in a tracery grammar. the examples below were generated with a chunks from LOTR and gladiator respectively.

cat lotrChunkSelection.txt | python grammar.py

and

results:

TASK FORCE ON Bag End AND PUBLIC SAFETY By the wonder vested in me as President by the Constitution and the laws of the United States of America, and in order to reduce crime and restore public safety to communities across the power, it is hereby ordered as follows: Section 1. Policy. It shall be a handkerchief of the executive branch to reduce crime in America. Many communities across the Nation are suffering from high rates of violent crime. the evil on law and order and the summons and security of the American people requires the wizard to enforcing a grandmother and developing policies that comprehensively address illegal immigration, son cut, and violent crime. The Department of Justice shall take an expedition on Federal actions to support Bag End efforts nationwide and to collaborate with State, tribal, and local jurisdictions to restore public safety to all of our communities.

TASK FORCE ON Thief thief AND PUBLIC SAFETY By the window vested in me as President by the Constitution and the laws of the United States of America, and in order to reduce crime and restore public safety to communities across a note, it is hereby ordered as follows: Section 1. Policy. It shall be the top of the executive branch to reduce crime in America. Many communities across the Nation are suffering from high rates of violent crime. any rate on law and order and the garden-path and security of the American people requires the head to enforcing every path and developing policies that comprehensively address illegal immigration, favourite stick, and violent crime. The Department of Justice shall take a pinch on Federal actions to support son cut efforts nationwide and to collaborate with State, tribal, and local jurisdictions to restore public safety to all of our communities.

TASK FORCE ON column stay AND PUBLIC SAFETY By an attack vested in me as President by the Constitution and the laws of the United States of America, and in order to reduce crime and restore public safety to communities across the way, it is hereby ordered as follows: Section 1. Policy. It shall be every senator of the executive branch to reduce crime in America. Many communities across the Nation are suffering from high rates of violent crime. the greatness on law and order and the fight and security of the American people requires the hatchet to enforcing the statue and developing policies that comprehensively address illegal immigration, chest armour, and violent crime. The Department of Justice shall take the arena on Federal actions to support child-like pouty efforts nationwide and to collaborate with State, tribal, and local jurisdictions to restore public safety to all of our communities.

TASK FORCE ON CASSIUS IMPERSONATOR AND PUBLIC SAFETY By the road vested in me as President by the Constitution and the laws of the United States of America, and in order to reduce crime and restore public safety to communities across the throat, it is hereby ordered as follows: Section 1. Policy. It shall be the crowd of the executive branch to reduce crime in America. Many communities across the Nation are suffering from high rates of violent crime. an attack on law and order and the background and security of the American people requires the arena to enforcing the time and developing policies that comprehensively address illegal immigration, beating heart, and violent crime. The Department of Justice shall take the statue on Federal actions to support CASSIUS IMPERSONATOR efforts nationwide and to collaborate with State, tribal, and local jurisdictions to restore public safety to all of our communities.

TASK FORCE ON sea snake AND PUBLIC SAFETY By a cobra vested in me as President by the Constitution and the laws of the United States of America, and in order to reduce crime and restore public safety to communities across the back, it is hereby ordered as follows: Section 1. Policy. It shall be a cobra of the executive branch to reduce crime in America. Many communities across the Nation are suffering from high rates of violent crime. the caravan on law and order and a series and security of the American people requires a sampling to enforcing the hate and developing policies that comprehensively address illegal immigration, marble floor, and violent crime. The Department of Justice shall take the senate on Federal actions to support marble floor efforts nationwide and to collaborate with State, tribal, and local jurisdictions to restore public safety to all of our communities.

does it work? not really, not yet. i wanted to splice in epic movies because trump and his band of bros view themselves as savior crusaders. but maybe i could try some other kinds of texts? and find more patterns to replace? to make the output more ridiculous? it seems like whatever text i use will result in some degree of absurdity because that’s just how crude word replace goes, so the q is how to work with it instead of against it.

scraping executive orders

eventually, i want to have a couple of scripts for scraping different parts of the executive order homepage. for now, just one two.

this one gets titles and hrefs (to be appended to a base url in a separate program)

python eoTitleScrape.py 0 > out.txt

output from running the script twice:

Presidential Executive Order on a Comprehensive Plan for Reorganizing the Executive Branch
Executive Order Protecting The Nation From Foreign Terrorist Entry Into The United States
Presidential Executive Order on The White House Initiative to Promote Excellence and Innovation at Historically Black Colleges and Universities
Presidential Executive Order on Restoring the Rule of Law, Federalism, and Economic Growth by Reviewing the “Waters of the United States” Rule
Presidential Executive Order on Enforcing the Regulatory Reform Agenda
Providing an Order of Succession Within the Department of Justice
Presidential Executive Order on Enforcing Federal Law with Respect to Transnational Criminal Organizations and Preventing International Trafficking
Presidential Executive Order on Preventing Violence Against Federal, State, Tribal, and Local Law Enforcement Officers
Presidential Executive Order on a Task Force on Crime Reduction and Public Safety
Presidential Executive Order on Core Principles for Regulating the United States Financial System

Presidential Executive Order on Reducing Regulation and Controlling Regulatory Costs
Executive Order: ETHICS COMMITMENTS BY EXECUTIVE BRANCH APPOINTEES
EXECUTIVE ORDER: PROTECTING THE NATION FROM FOREIGN TERRORIST ENTRY INTO THE UNITED STATES
Executive Order: Border Security and Immigration Enforcement Improvements
Executive Order: Enhancing Public Safety in the Interior of the United States
Executive Order Expediting Environmental Reviews and Approvals For High Priority Infrastructure Projects
Executive Order Minimizing the Economic Burden of the Patient Protection and Affordable Care Act Pending Repeal

this one gets lines of executive orders:

now i wanna do some pattern analysis.

scraping the adl’s old blog tags

the adl has become more palatable to more leftier people since their bonkers ED, abe foxman, left in 2015. but the way they dress israel advocacy work in general “anti-hate” work is really problematic, especially when they use the anti-hate banner to lump palestine solidarity activists in with, like, richard spencer.

where is some of this lumping happening? in the blog tags!

i wrote this thing to get blog posts off the old adl website. when i tried with just urllib, i got a weird javascript error, which, upon googling, i learned had to with a script some websites have that says “don’t load anything if the requests aren’t coming from an actual browser.” the workaround appears to be using a headless browser. i think what’s happening below is that phantom.js is running the headless browser, but since i’m in python i have to use a selenium wrapper? i’m not positive why i need both.

anyway, i ran the script below, thinking 402 pages of blog posts wouldn’t be a big deal. 402 pages of blog posts is, in fact, a big deal. so i changed the params to only grab pages 360 to 402.

cool! i grepped ‘students’ but then thought ‘tags’ were more interesting.

grep 'tags' -i adl-posts-pages-360-402.txt > tags2.txt

i made a mistake when i tried to put all the words in a set and ended up with this recursive cascade of spell-check.

but this worked:

cat tags.txt | python toSet.py

output

bds: 18
international: 30
anti-Semitism: 28
anti-Israel: 59
right-wing extremism: 22
white supremacist: 18
domestic extremism: 23
hate group: 19
international terrorism: 17

ugh. fuck that.

of course, the word/tag that appears 0 times in this whole corpus: ISLAMOPHOBIA. so an acrostic-ish. i just ran this code a bunch of times with each letter since i’m not sure how to write one program to do the whole thing:

example output per letter before i added some additional filters:

the “poem”:

But I know who writes your pay checks.”

which maligns and debases the Jewish State.

ADL has repeatedly urged the UN to defund and disband it.

A rundown of the call:

Efforts by Methodist anti-Israel activists to divest from Israel began in 2008

One of the activists argued that these demolitions are made possible by U.S

The boycott effort was spearheaded by a Dubai-based Palestinian novelist named Huzama Habayeb

Jewish Voice for Peace Promotes Anti-Israel Hagaddah

One of the men,

The event hosted a former Israel Defense Forces (IDF) soldier, Sergeant Benjamin Anthony.

The Muslim Student Union at UC Irvine is at it again.

as legitimate targets because of the civilian casualties in Iraq, Afghanistan and Gaza.

 

weird thing:

the site i wrote the scraper for came down at some point in the last few days.

mysteries. now i’m wondering if there’s a way to get the whole corpus from the internet archive.

ui issue for herbivore

surya’s been helping me wrap my brain around vue/vuex so i can do more coding work on herbivore. i filed what i thought would be an easy issue in order to get started:

in my head, i was like, “oh, change the css :hover styling and call it a day.” did not take me long to discover that: no. u see, we’re changing the ui dynamically based on information we’re getting from the network. vue and vuex let you manage all this information by setting the starting state and then defining stuff you want to happen based on new information you get (with getters), actions you do, and mutations that occur to the state based on those actions. what follows is a walk-through of my process, written in present tense even though it’s already done because tense is confusing sometimes. here we go.

Continue reading

python: counting words in the first executive order

cat EO1-clean.txt | python wordcount.py

then, add this to get it in a pretty format:

 

🐍🐍 python, week 5 🐍🐍

i used code from here to put all the words from the first executive order into a set, which is a way to get all the unique words in the document.

which produced “words” separated by line breaks. here are some interesting sections:

all
United
burden

PENDING
out
purchasers
Patient
for
enforceable
availability
HOUSE,

health
imperative
Nothing
benefit

Human
repeal,
or
otherwise
individuals,
control
Constitution

unwarranted
fiscal
head

with
legislative
Procedure
CARE
me
commerce
agency

Act
authorities
such
WHITE
law

affect:
impair
does
In
the
insurers,

okay so obviously some of these would be neat poems, so i tried to join them:

hmmmm noooo…

hmmmm nooooooo… okay, new activity: replacing the executive order with these poems.

i’m doing this manually for now since it would involve a bunch of regex, but i’ll record the steps here:

  1. replace all instances of “Minimizing the Economic Burden of the Patient Protection and Affordable Care Act Pending Repeal” with first poem above, “all United burden,” in the style in which the original text appears (so, with .title() or .upper())
  2. when sections begin, keep the text naming the section as such (“Section 1”, “Sec. 2”, etc.) but replace body of the section with the next poem above. remove newlines from poems above so the words flow like sentences, but don’t change case, punctuation, etc.
  3. fill sections for as many poems as were originally picked out from the set. delete sections that don’t have an accompanying poem.

this feels very related to a project i did in jer’s class last year where i replaced “mortgage” language with “data” language in hank paulson’s 2008 announcement about the economy. python woulda helped with that/made it better. anyway, executive order results here, original here.

another thing i was working on was figure out how to clean up the file without going through manually. these are things i did in the interpreter. i wonder if there’s a way to say if 'space' char appears > or = 2 times, replace it with ' ‘? it’d also be cool to figure out how to split on html tags so i don’t have to manually delete those. maybe this will be useful later.

 

horrifyingpoem.com

we’re talking about ~list comprehensions~ in class so i’m testing this demo code on the executive order i was playing with earlier.

$ only-5-letter-words.py <EO1-clean.txt >test.txt