Marc, Looking at the source, yes, you do need a parser but, here, it can be really basic as you just want all the text from the web address.
Try this: widget.GenPollUrl(url="http://ifconfig.co/country-iso", json=False, parse=lambda x: x.strip()) The parser function just runs the strip function on the text you get back which removes the trailing new line. Also, the widget defaults to expecting json so you need to turn that off too. On Sunday, 22 November 2020 at 21:10:18 UTC odea wrote: > > Hi, > I'm a bit confused with the widget.GenPollUrl() function, do I really have > to create a parser myself ? The URL I'm querying is this one : > http://ifconfig.co/country-iso and I just have one word as a result. > If I have to create a parser, if someone could give me the code for a very > simple one that would be great ! > Thanks for your help, > Rgds > Marc > -- You received this message because you are subscribed to the Google Groups "qtile-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/qtile-dev/78ff7e36-b567-4d5f-87c1-f1665c0691ccn%40googlegroups.com.
