Skip to content

Instantly share code, notes, and snippets.

@aitor
Created February 2, 2010 12:44
Show Gist options
  • Save aitor/292632 to your computer and use it in GitHub Desktop.
Save aitor/292632 to your computer and use it in GitHub Desktop.
# 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