Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a zim file set up and download UI #19

Open
dps opened this issue Mar 13, 2021 · 8 comments
Open

Implement a zim file set up and download UI #19

dps opened this issue Mar 13, 2021 · 8 comments

Comments

@dps
Copy link
Owner

dps commented Mar 13, 2021

No description provided.

@cowpod
Copy link

cowpod commented Mar 13, 2021

If it helps, I can set up an api that periodically parses the kiwix zim downloads section. All that would be necessary is fetching a page, which gives a json reply.
Otherwise, they probably have an api already; their kiwix android app source is here: https://github.com/kiwix/kiwix-android

@dps
Copy link
Owner Author

dps commented Mar 13, 2021

Thanks for the offer... That would be really great. There's a bit more to it - they unfortunately don't have a very stable format for the markup inside the zim files so I think I need something that chops the kiwix boilerplate (which changes) off the front of each page...

@cowpod
Copy link

cowpod commented Mar 15, 2021

I've completed an API in PHP; it scrapes the kiwix wiki page's table values, which returns JSON data organized into an object array. It refreshes data once per day.

A downside of using this is the risk of the server going down, but upside is offloading quite a bit of parsing work from the reMarkable; parsing a massive table takes a while.
Ironically my server is currently down with errors 500 and 503, but I'll upload it when I can, and then you are welcome to use the hosted API directly.

API use: https://rmwk.api.snorfi.us/?sort=category, where category can also be language/size/date/type/download

@dps
Copy link
Owner Author

dps commented Mar 15, 2021 via email

@cowpod
Copy link

cowpod commented Mar 15, 2021

It's got a weird certificate due to the hosting issues - normally it's fine; I've got my own certificate.

I've attached the latest file below. It needs PHP modules php-curl and php-dom. It also needs file_put_contents and file_get_contents enabled. I can also probably get it working without php-curl, and with sqlite/mysql instead of flat files - let me know if you want that.

I've put it under an MIT license as well; seems to be the freest. I did my best to sanitize the $_GET values, however obviously there's no warranty/guarantees with it.

Edit:

Fixed the inconsistent formatting. Sorting by size is still a bit wonky - it doesn't understand the K/M/G suffixes.
index_v2.zip

@cowpod
Copy link

cowpod commented Mar 16, 2021

I've switched hosts to one that's hopefully more reliable - If you still need it, the API is available at https://api.snorfi.us/rmwk/?sort=download. It's also cached with cloudflare, so in the event of downtime it should be okay.

@dps
Copy link
Owner Author

dps commented Mar 16, 2021 via email

@cowpod
Copy link

cowpod commented Mar 16, 2021

Reposting my edit, as I see that you use email:

Fixed! uploaded to my site and attached here;
index.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants