Last active
October 25, 2016 13:34
-
-
Save Cyan101/c6bd12ca36b39179bdd59a587a2fd0d7 to your computer and use it in GitHub Desktop.
Custom parser for http://github.com/Z64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'htmlentities' | |
coder = HTMLEntities.new | |
puts "Pack name please" | |
packname = gets.chomp | |
template = ["---\n", "expansion: #{packname}\n", "authors:\n", "- CAH\n", "- Cyan101\n", "questions:\n"] | |
loop do | |
puts "Saved file name" | |
filename = gets.chomp | |
break if File.exist?(filename) | |
filename = (filename + ".yaml") | |
break if File.exist?(filename) | |
puts "Couldn't find the file, please try again" | |
redo | |
end | |
toconvert = File.readlines(filename) | |
space = toconvert.index("\n") | |
toconvert.each_with_index do |x, i| | |
toconvert[i] = x.include?(':') ? ("- '#{x.chomp}'\n") : ("- #{x.chomp}\n") | |
end | |
toconvert[space] = "answers:\n" | |
out = template.join("") + toconvert.join("") | |
File.open(filename, 'w') { |f| f.write(coder.decode(out)) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A wise man said, "Everything is about sex. Except sex. Sex is about _." | |
Our relationship is strictly professional. Let's not complicate things with _. | |
Corruption. Betrayal. _. Coming soon to Netflix, "House of _." | |
Because you enjoyed _, we thought you'd like _. | |
I can't believe Netflix is using _ to promote House of Cards. | |
We're not like other news organizations. Here at Slugline, we welcome _ in the office. | |
I'm not going to lie. I despise _. There, I said it. | |
Cancel all my meetings. We've got a situation with _ that requires my immediate attention. | |
If you need him to, Remy Danton can pull some strings and get you _, but it'll cost you. | |
Forcing a handjob on a dying man. | |
A homoerotic subplot. | |
An origami swan that's some kind of symbol? | |
25 shitty jokes about House of Cards. | |
My constituents. | |
Punching a congressman in the face. | |
Strangling a dog to make a point to the audience. | |
A childless marriage. | |
A much younger woman. | |
An older man. | |
Getting eaten out while on the phone with Dad. | |
Making it look like a suicide. | |
Carbon monoxide poisoning. | |
Discharging a firearm in a residential area. | |
Ribs so good they transcend race and class. | |
The sensitive European photographer who's fucking my wife. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why didn't you use an existing markdown converter like I did? did i miss some manual processing I should have done?