fix user agent for external HTTP requests
This commit is contained in:
parent
69b3680361
commit
adab4a23fd
|
@ -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] != '#':
|
||||||
|
|
Loading…
Reference in New Issue