DEV Community

rhymes
rhymes

Posted on

Changelog: export posts

There is a new feature in town ๐Ÿ˜…

You can export your dev.to posts, you'll receive an email with an attached zip file containing a JSON with all your posts.

How do I do that?

You go to https://dev.to/settings/misc and select export, but I also prepared some screenshots so bear with me:

then after submitting the form this happens:

and after a little while you get an email like this one in your inbox:

This is an example of what's inside the file:

I'm a developer, how did you accomplish that?

The feature is quite simple in a sense:

  • you request the export
  • the backend takes note of that
  • a background job starts, collects the posts, converts data and metadata in json
  • creates a zip file in memory and adds the json file to the zip
  • the zip file gets attached to the email
  • the email is sent

Some backstory about this feature

A few months ago, prompted by a feature request, I started working on a pull request to do the above. Then I forgot all about it, then I submitted it but it wasn't that great because I didn't know that much about the code (still don't really :D) and because it could have been better in general.

My PR nonetheless started a conversation with @ben, @maestromac and @jess and after a refactoring and another round of reviews (yay for pull requests!) what has been merged today is something... just better.

What about the rest of the data?

I know the dev.to team is aware of that, this is just a first step.

Top comments (19)

Collapse
 
ben profile image
Ben Halpern

This is such a great step towards our commitment to data portability and fostering a healthy relationship with everyone on platform.

DEV is a partner to each and every community member, and has a special relationship to those who trust us to co-publish their work. It's not like people will need their data in this format all the time, but when they want it, they should get it.

Great work rhymes.

Collapse
 
nektro profile image
Meghan (she/her)

Nice! Is there any plans to have any of this data in dev.to/rhymes/changelog-export-pos...

Collapse
 
rhymes profile image
rhymes

What do you mean? Title and creation date are in the export.

ps. didn't know there was a JSON metadata endpoint for the post :D

Collapse
 
nektro profile image
Meghan (she/her)

Is any of the export data going to be added to the endpoint (like markdown/reaction count)?

Thread Thread
 
rhymes profile image
rhymes

I don't know, you should ask the team or open a feature request. Didn't know it existed ๐Ÿ˜‚

Thread Thread
 
thepracticaldev profile image
dev.to staff

I... also didn't it existed. It's looks like a remnant rails scaffold that never got removed. Thanks to Rails magic it generates a whole endpoint because the file exists.

I panicked for a second because this is the kind of thing that could result in a data leak but things look okay.

And yeah, I think it makes sense for that page to expose relevant data.

Thread Thread
 
ben profile image
Ben Halpern

Whoops, logged into wrong account there.

Thread Thread
 
glennmen profile image
Glenn Carremans

They say any advertising is good advertising but I don't think you want your website being "advertised" by Troy Hunt ๐Ÿ˜‰ haha

Thread Thread
 
piecewide profile image
Tyrone Douglas

I don't think it is a good idea!
snake game

Thread Thread
 
piecewide profile image
Tyrone Douglas

Is there any solution for it?
snake game

Collapse
 
david_j_eddy profile image
David J Eddy

Nice going! Awesome first issue task. I hope to see more integrations and asset migration options in the future for dev.to. People like you make it possible.

Collapse
 
darksmile92 profile image
Robin Kretzschmar

Really great feature!

Even I don't need it right now, I like the idea behind and the open relationship between dev.to and the members.

This really enhances the platform a lot in my opinion, so thank you :)

Collapse
 
rhymes profile image
rhymes

Thank you Robin, you capture the central idea exactly.

I hope, I or whomever will contribute next, we'll be able to expand and refine this feature in the near future

Collapse
 
deciduously profile image
Ben Lovy

This is awesome. I plan to use it regularly. Thank you for your work!

Collapse
 
creativ_bracket profile image
Jermaine

Thanks Rhymes. That is pretty useful.

Collapse
 
dangolant profile image
Daniel Golant

This is awesome! Out of curiosity, would you be willing to share your use-case for the export?

Collapse
 
rhymes profile image
rhymes

I just implemented the first feature because I was interested in learning a bit more about the source code.

I don't currently have a use case, but I know various users have asked for the possibility to export. It's the first step in a possible migration path.

After all the content is yours...

Collapse
 
dangolant profile image
Daniel Golant

Totally, makes sense, just curious

Collapse
 
serialeturcesti profile image
clicksud

Ohh this is a great step. I will help us a lot.
blogul-lui-gian.com/