Last active
August 29, 2015 14:25
-
-
Save m-note/dc1c639a4211ea1fb464 to your computer and use it in GitHub Desktop.
recordDiet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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