fix user agent for external HTTP requests

This commit is contained in:
Christine Dodrill 2016-02-11 04:57:52 -08:00
parent 69b3680361
commit adab4a23fd
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ proc fromDBRow*(r: Row): Tweet =
proc getTweetsFrom*(url: string, username: string): seq[Tweet] = proc getTweetsFrom*(url: string, username: string): seq[Tweet] =
var res = newSeq[Tweet]() var res = newSeq[Tweet]()
let body = url.getContent(timeout=20_000, userAgent = "https://twtxtlist.cf " & version & " (+https://xena.greedo.xeserv.us/files/xena.txt; @xena)") let body = url.getContent(timeout=20_000, userAgent = "twtxtlist/" & version & " (+https://xena.greedo.xeserv.us/files/xena.txt; @xena)")
for line in body.splitLines().items(): for line in body.splitLines().items():
if line.len > 0 and line[0] != '#': if line.len > 0 and line[0] != '#':