From Pastebin to Gist: Not So Fast!
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
Published on 02 Dec 2016
by Alexander Garber
all tags
100daysofcode activerecord android annoyances api apt arch array artix atom az3w backend bash blog browser bug callback career ci-cd cli cloud code coding config configuration cp crud cryptography css csv database db demo design devops django docker email erp feelsgood filter fugitive gif gist git gmail gnome gnome pomodoro grep hebrew http ide isbn-fetcher iso javascript job search js kanban kindle koans learning linkedin linux logger manjaro map markdown microservices mobi mtp neovim nodejs nvchad packages panda pastbin patch portfolio post postgres pytest python rails reduce refactoring reflections rest routes rspec ruby salesforce script scripting security sed shell sql string_replacement study tasks tdd terminal testing tmux ttd version_control vim vim sort walkthrough webdev workflow zsh