Skip to content

Instantly share code, notes, and snippets.

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

Embed
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 = "https://api.cognitive.microsoft.com/bing/v5.0/search?q="
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")
println(page[i]["displayUrl"])
println(page[i]["snippet"])
end
end
#= Sample output.
printResults("health care", "Foucault")
Result 1
https://www.ukessays.com/essays/health-and-social-care/foucault...
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
https://plato.stanford.edu/entries/foucault
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
www.michel-foucault.com/info/faq.html
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
https://en.wikipedia.org/wiki/Governmentality
In his lecture titled Governmentality, Foucault gives us a ... explaining the operation of evidence-based health care and the internalization of clinical ...
Result 5
https://healthafteroil.wordpress.com/2011/05/12/as-health-care...
As Health Care Fails, Part I: Power, Knowledge and ... “Mainstream health care’s going to ... according to Foucault- they address health issues ...
Result 6
https://en.wikipedia.org/wiki/The_Birth_of_the_Clinic
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
https://www.laurakkerr.com/wp-content/uploads/2012/05/Kerr...
Foucault and the Care of the Self: Educating for Moral Action and Mental Illness According to the World Health Organization ...
Result 8
www.sciencedirect.com/science/article/pii/S1353829207000342
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
https://www.healthcare6.com/physician/saint-petersburg-fl/ostile...
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
www.academia.edu/2202454/Foucault_Foucauldians_and_sociology
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.