Topic: Get total post count via API

Posted under e621 Tools and Applications

I am parsing the CSV from the db_export I have downloaded for the day, and it would be really nice to display a progress bar. To do this, I would either need to load the entire file (which is what takes the time in the first place, so is not feasible), or I need some way of approximating the number of posts the file will contain.

My idea would be to use the current post counter, as seen on the homepage, to get an approximation of number of posts for a rough loading bar and ETA.

Is it possible to access this post counter in a machine readable format, or even better, have some kind of metadata for the exports which tells you exactly how many rows are in the files?

Thanks!

Just report the current file pointer location and the size of the file in bytes. There's no way the size of the entries varies enough that that isn't a reliable estimate.

wat8548 said:
Just report the current file pointer location and the size of the file in bytes. There's no way the size of the entries varies enough that that isn't a reliable estimate.

This is something I hadn't considered. Not sure how I missed that one. Would still be cool to have this number on the API, however this is actually the perfect (and more accurate) way to parse the CSV files, thanks!

  • 1