Created
February 2, 2010 12:44
-
-
Save aitor/292632 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# How fucking fucked can the most fucked up company get when messing around when formats? | |
# Well, really fucked. | |
# So fix their fucking mess: Telefonica pk7 invoices to pdf | |
# Use: ruby fucktura.rb file_name.pk7 | |
require 'base64' | |
FACT_LABEL=/<FACB64>(.*)<\/FACB64>/m | |
fucktura = File.open(ARGV[0]).read[FACT_LABEL, 1] | |
2.times do | |
fucktura = Base64.decode64(fucktura) | |
end | |
File.open( "#{ARGV[0][/(.*)\./,1]}.pdf", "w" ) do |fuck_out| | |
fuck_out << fucktura | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment