I
I
IceJOKER2014-08-27 11:45:22
Android
IceJOKER, 2014-08-27 11:45:22

What is the best way to implement such functionality?

I want to write a program that will periodically update data from the site, save it in the database and display it, but here's the trouble, there is over 1000 information on the site and this information is updated, how to do this:
At the first start, you need to download information from the site / save and output (there is such an implementation in my head - see how many records are in the sqlite table and if there are none, then unload all the information)
On subsequent runs, you need to check if this information is present and if not, then add (but how to do it? load over 1000 records again and go through everyone with a check whether there is such a record and if not, then add it?)
Who faced similar functionality, share how best to implement

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2014-08-27
@xmoonlight

This approach:
1. Look in the hash1 database (pagesize+timestamp) and in the server response (in the response header of the GET request from the web server: header). Here the page will not be transferred (unless you request it later). Updated (different hashes) - load the content itself and go to step 2.
2. XML search for the desired element (specified in the database) and again comparison with the hash (the content of the desired XML container - hash2). Updated (different hashes) - update the content in the database, no - skip and go to the next one.
in multiple streams respectively....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question