Skip to content

Instantly share code, notes, and snippets.

@m-note
Last active August 29, 2015 14:25
Show Gist options
  • Save m-note/dc1c639a4211ea1fb464 to your computer and use it in GitHub Desktop.
Save m-note/dc1c639a4211ea1fb464 to your computer and use it in GitHub Desktop.
recordDiet
def recordDiet(speaker, startRec=1, any="", Dfrom="0000-01-01", Duntil="9999-12-31"):
search = searchKeyword(speaker, startRec, any, Dfrom, Duntil)
XMLcontent = DietSearch(search)
temp = XMLextractSpeech(XMLcontent)
newStart = int(temp[0])
extracted = temp[1]
while newStart != 0: #newStartが0じゃない、つまり先がある限り続ける
search = searchKeyword(speaker, newStart, any, Dfrom, Duntil)
XMLcontent = DietSearch(search)
temp = XMLextractSpeech(XMLcontent)
newStart = int(temp[0])
extracted.extend(temp[1])
return extracted
recordDiet(speaker="安倍晋三", any="アベノミクス", Dfrom="2014-10-01", Duntil="2015-05-20")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment