Proper way to periodically check an api for new data? [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I was wondering if there is a proper way to periodically check an api for updated data. I'm looking for a more efficient solution than a while loop with a delay timer.
Are there any standard headers that can be checked to see if content was updated (in order to skip comparing previous results to the new ones?)
Additional notes
I using python at the moment but this is a broad question regarding all programming languages.

You probably want to look at the Conditional Requests spec and the Caching spec.

Related

Telling if stories are fake or real using Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 days ago.
Improve this question
I am looking forward to building a program in python which tells if a text is fake or real. This is a project I want to start for educational purposes. For example, someone is sharing a story, the program will check the input and will determine whether the author is likely telling truth or fiction based on common patterns. I am looking for some things I can start off from, like libaries or documentation. Thanks for anyone who is willimg to help.

Multiple field include exlude with python and mysql [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
My api needs to be something like this:
api/search_fields=country_name,region,city,pincode,dma&exclude=false,true,true,false&country_name=india,pakistan&region=tamil nadu,jammu kashmir,&city=ahmedabad&pincode=112&dma=1
Means if country_name is excluded their correspoding region,city,pincode,dma will not come in result.Same way if region is exluded city,pincode,dma will not come in results of which all countries are excluded and which all regions are excluded.
How can i write mysql template in python for all these.
Although the question is very wide, I will try to answer.
The general idea is checking what the user has specified in the request and then hide absent columns in the output. We call it a view logic. You can take care of it in Controller or in Template directly.
Probably, it does not help you too much, but I cannot answer another way so broad question.

Reusing IPython's comm objects and widgets externally [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
IPython has a great concept of comm objects, which are basically pairs of objects - one on Python side and the other in JavaScript - which pass messages between them allowing for underlying widget objects to be transformed in unison on the server and client sides.
I'm planning to reuse the same concept in an application I'm writing, so I'm considering simply reusing the actual implementation from IPython rather than writing one of my own. Does anyone have any experience that, and could provide me with some suggestions and caveats?

Realtime collaboration in Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Is there any known way to do realtime collaboration stuff (like Google Docs) in Python (not thru the browser)? I'm working on a program, and would like to add said feature to it.
Thanks
You can try Dweet, which is a service that stores JSON data in key values pairs. You can use one of the client libraries listed on their website or you could simply make a request like so:
urllib.urlopen('https://dweet.io/dweet/for/my-thing-name?dweet=awesome')

How to Write Network Protocol Handlers [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm trying to write my own protocol so that multiple servers can pass data and connect with each other, kind of like mongo://. I have been looking at TCP & I understand ports, but how do I write something so that people can just do something like connect("proto://example.com:6767/") ?
Also, I'm writing in python.
Thanks!
I believe you need to look into urllib2 and writing a subclass of BaseHandler, specifically the functions protocol_request and protocol_response.
Whether the way urllib2 handles request/response cycles suits your application is up to you to decide -- it may or may not be exactly what you want.

Categories