Show how many times page has been saved on Wayback
gingerbeardman opened this issue · 15 comments
Let me peek at the API response :)
Could you send me the original SVG for the logo? If I update to add the count, I would want to update the app icon at the same time
Seems like Wayback Machine gets the count from https://web.archive.org/__wb/sparkline?collection=web&output=json&url=https%3A//www.otzberg.net/wayback
That extension is extremely talkative, it pretty much sends a server request to archive.org for EVERY page you visit so it can show you that badge. If you are logged in, it does seem to send a cookie along as well, so it can trace you even better. I trust that those guys aren't evil, but it does make me feel uneasy about it (I ended up disabling).
Anyhow, we can easily include that sparkline count ourselves - I'll have a play this week
I agree with your sentiments. Maybe our extension could only make those requests when the window is opened? That's the point I want to see them, requesting the data before is unwarranted.
Good new, Wayback already makes API calls only when needed (i.e. when the popover is opened). It's the reason we show the spinner, but I would be super uncomfortable otherwise.
I believe this is what I need to do:
- Identify if https://web.archive.org/__wb/sparkline?collection=web&output=json&url=.... is public endpoint
- Evaluate if there is anything in https://archive.org/wayback/available?url= that we need
- TBD replace one with the other
- Figure out how to display the data
@gingerbeardman
Could you please give me your thoughts on how to best display this data?
Will have a think today
Here's an idea - what if the number would be shown in parenthesis behind "Show Page History", as in
Last archived:
18 days ago
---
Save Current Page
----
Show Page History (98)
remaining links
?
I prefer the former (after history) because it seems more relevant? But I can see there may to be enough space.
Though I don't mind either.
Thank you so much for your feedback @gingerbeardman ! I found a few examples of where large save counts cause me some concern with the display. This is something I should be able to address, I agree it makes most sense to show it there, I just need to play a bit with the display (maybe simply making the window a bit wider ;) )
Fine by me 👍 nice work, thank you
I have submitted this to the appstore this morning #29 and hope that it will work well. I also made a change to the function that opens the tab that caused crashing and I have been able to reproduce crashing since, I'll close the other issue as well - but we an reopen should you notice it again! Many thanks for your kind and generous collaboration
There's a bug where the history total is not overwritten from a previous tab if there is no history result with the current tab:
- click WBM icon on a tab with history results (shows number)
- click WBM icon on a tab with no history results (bug: shows same number)
- click WBM icon again on same tab with no history results (correctly shows no number)
I made this a new issue