From Pastebin to Gist: Not So Fast!
Published on 02 Dec 2016
by Alexander Garber
I published my first paste on Pastebin five years ago (at the time of writing), and Pastebin has been very good to me ever since, but it's time to migrate my data to Gist on Github.
I looked around for an automated migration solution, but couldn't find any.
Then I thought about copying and pasting all my pastes, but that's stupid, laborious work, and no self-respecting programmer would do something so repetitious.
So what's the clever solution?
The following headers are the skeleton of my plan. I will update this post as I progress.
Part One: Get the raw pastes from Pastebin
Pastebin API
Pastebin has a scraping API and a developer's API which costs a lifetime membership. At the time of
writing there is a big discount on lifetime membership, so I bit the bullet and got it. The practice it gives me will be more than a decent ROI.
Construct the Query, in Ruby
All the sample scripts are given in PHP, but there must be a way to do it in Ruby, or failing that, in JavaScript.
Execute the Query
Part Two: Upload the raw pastes as separate Gists
Github API
Construct the Script, in Ruby
Execute the Script
all tags
activerecord android annoyances api apt arch array artix atom az3w backend bash blog browser bug callback career cli cloud code coding config configuration cp crud css database db design devops django email erp filter fugitive gif gist git gnome grep hebrew http ide isbn-fetcher iso javascript job search js kanban kanban\ kindle koans linux logger manjaro map markdown microservices mobi mtp neovim nodejs packages pastbin patch post python rails reduce refactoring rest routes rspec ruby scripting security sed shell sql string_replacement study tdd terminal testing version_control vim walkthrough workflow