A Small Download Feature For the Post Listing

in #steemdev6 years ago (edited)

As people have started to discover that scrolling their feed actually stops loading after a while (this is a bug, HiveMind should get this squared away), more and more people have discovered the little tool I made to help with getting a view of the entire history of posts for a given author.

Since then I've gotten a few requests that I was able to integrate, like tag filtering, and now more recently, @tarazkp was wondering if this could also offer a way to download a zip file of the contents for all of these posts. Yesterday I took a few moments to poke around this question. One of my coworkers thought that this might not be possible because usually initializing downloads needs to come as a request from a second server, but I was happy to find that at least for some browsers, it is possible to initiate a download all through client-side javascript.

The tool that makes this possible is JSZip and a FileSaver utility, which you can find details in this FAQ for how to set this up. I then copied the JSZip files into my own repository and linked FileSaver through some hosted site (probably could have done both, but couldn't find).

It has a very simple interface, where you simply initiate the zip file, throw in files, and then call the utility to initiate the download in the browser.

The result is now that after the posts load, a Download button will appear and download the markdown contents of all your posts into a zip file.

Possible limitations:

  • This should work for most modern browsers, and there may be some file size limitations. At the moment I've just generated this quickly, and you may need to check to see that all of them are indeed there. Soon I should aim to add some amount of feedback for which cells were handled with no errors.
  • Note that deleted posts seem to show up in the feed, and I did not handle it appropriately, but the downloader will simply skip those.

But anyway, here is the link again, where you can see it with my account name pre-filled, but there's a form you can use to provide your own names and own tags to filter:

https://eonwarped.github.io/steem/allposts.html?account=eonwarped

Here's how it looks:
downloadbutton.PNG

Yes I know it's rough, and I welcome any other utility page to repurpose what's in here into their own tooling.

Well that's all for now, happy snapshotting! Do spread the word. I feel that more and more people are starting to discover that the scrolling stops loading posts. And who wants to keep scrolling anyway? I know I don't. And you don't see the resteems!


Edit: The download may not reflect all edits. Need to do some testing for that. (Testing it now :) )
Edit2: Yes, the downlader picked up the last edit. awesome!

Sort:  

I like that. The tag, now I can figure out when I started using #justbecause as a tag. And that was - - 2017-11-07T09:36:57 for a whopping 188 post with that tag for me.

I'm reading your code here and I can't find how you filtered original posts from post edits (which are all stored as "post" in the blockchain). I feel like I'm missing something o.o

Ah, I saw that one! I just didn't know what that variable did. So edits have the same permlink and you only store the first instance. Hmmmm, but as I had mentioned before on chat, this would only read the original and not the final state of the post. Do you have a way around this beyond Hivemind?

I fetch again using the getContent endpoint. It reflects edits too. whew!

Ooooh! That does it! :DD

Ok, I'm happy that this exists. This solves what I wanted to do. <3

Actually it reads the latest one right now, so things get a little out of order haha. but I just didn't bother making it link to the original edit.

Oh.... I forgot about that. I need to check what the actual contents are. I would have assumed it takes the latest edit though....

I love this tool and use it quite often.

Now it’s even better! I have been wanting to keep a copy of my posts offline but have been too lazy to go save a copy, so my procrastination has, for once, paid off.

Thanks for this!
~T

Ah I was about to forward this to you because I vaguely remember you might have wanted this too. Great that you found it :)

Posted using Partiko Android

Thanks for this mate. :)

The entire zip (2090 posts) was just over 8 MB.

Ther is obviously a lot of ways the development could go in terms of layout (it is plain text) and searchability like perhaps adding the tags separated into the file name for future searching but, it is a really good thing for me so thank you again.

Yeah, also I suspect if you unpack them even into say some cloud provider, it will index the files for you for searchability too.

oh, that is worth a try

Eon, I positively love this feature. You have "eternal credit" with me for inventing it.

"Eternal credit with me" = upvotes on demand at 100% for any damn thing you write. ('Cause it's usually worth that anyway.) That's not worth much right now, I know, but they have been before and they will be again. I can see it coming. (Also ... I have "connections." You can certainly figure out what that means.)

"Eternal credit with me" also = I stand ready to send lawyers, guns and money to any situation where upvotes won't help. Keep your cellphone handy.

BTW, Why aren't you posting you know where? I seriously want to know. DM me. Please.

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.029
BTC 64512.68
ETH 2615.54
USDT 1.00
SBD 2.82