Skip to content

Instantly share code, notes, and snippets.

@arnavs arnavs/search.jl
Last active Jul 20, 2017

What would you like to do?
A script to help with debate research.
# A script to take one list of words (topic-related), and one list of words (philosophy-related), and get searches for all the related words.
# Dependencies.
using Requests
using JSON
apikey = "919db630ecc84118a1acc2914dc7bd55"
# Words.
topicWords = ["health care", "single payer", "public option"]
philWords = ["genealogy", "phenomenology", "Foucault"]
# Prepare search.
baseURL = ""
searches = [baseURL * (topic * "%20" * phil) for topic in topicWords, phil in philWords]
searches = [replace(search, " ", "%20") for search in searches]
# Actually search.
responses = [get(search; headers = Dict("Ocp-Apim-Subscription-Key" => apikey)) for search in searches]
# Return answers.
answers = [JSON.parse(readstring(response)) for response in responses]
# Process answers.
pages = [answer["webPages"]["value"] for answer in answers]
# Inspect results.
function printResults(topic::String, phil::String)
n = findin(topicWords, [topic])[1] + 3*(findin(philWords, [phil])[1]-1)
page = pages[n]
for i in 1:10
println("Result " * "$i")
#= Sample output.
printResults("health care", "Foucault")
Result 1
Foucault's Theory Of Power. ... NHS Wales and Health and Social Care in ... them to take care of their bodies as Foucault highlighted, through public health ...
Result 2
Michel Foucault (1926–1984) was a ... (tells what they know or what is the state of their health) ... a scientific example and an object of care.
Result 3
Would modern health care be any different if Foucault had become a plumber, ... in Michel Foucault: Une histoire de la vérité, Paris: Syros, 1985, pp. 58-9.
Result 4
In his lecture titled Governmentality, Foucault gives us a ... explaining the operation of evidence-based health care and the internalization of clinical ...
Result 5
As Health Care Fails, Part I: Power, Knowledge and ... “Mainstream health care’s going to ... according to Foucault- they address health issues ...
Result 6
The Birth of the Clinic The Birth of the ... and the care with which it silently lets things surface to the observing ... Michel Foucault's Archaeology of ...
Result 7
Foucault and the Care of the Self: Educating for Moral Action and Mental Illness According to the World Health Organization ...
Result 8
The role of nursing in governmentality, biopower and population health: ... in health care focus towards an emphasis on ... Bunton, R. (Eds.), Foucault, Health and ...
Result 9
Ms. Ostile Foucault Peck - Saint Petersburg FL, Nurse Practitioner at 6350 Central Ave A View info, ratings, reviews, specialties, education history, and more.
Result 10
Foucault, Foucauldians and Sociology ... which are highly relevant for the application of the position in the social analysis of health and health care. First ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.