Skip to content

Instantly share code, notes, and snippets.

@sapslaj
Last active December 15, 2015 22:39
Show Gist options
  • Save sapslaj/5334332 to your computer and use it in GitHub Desktop.
Save sapslaj/5334332 to your computer and use it in GitHub Desktop.
Quickly make Chrome Apps from URLs! (Now with ICONS!)
# written by sapslaj
print "Quick Chrome URL App Generator Thingy\n"
print "=====================================\n"
print "Name:\n"
name = gets
print "App URL: \n"
appurl = gets
print "Icon File:\n"
iconfile = gets
print "Icon Size? (in DIPs)\n"
iconsize = gets
print "Generating...\n"
final = <<EOF
{
"app": {
"launch": {
"web_url": "#{appurl.chomp}"
},
"urls": [ "#{appurl.chomp}" ]
},
"icons": {
"#{iconsize.chomp}": "#{iconfile.chomp}"
},
"manifest_version": 2,
"name": "#{name.chomp}",
"version": "1"
}
EOF
print "Finished Generating. Enter manifest file name: \n"
manifest = gets
print "Writing to file...\n"
out = File.new(manifest.chomp, 'w')
out.puts final
out.close
print "Done. File saved as #{manifest}"
@Walkman100
Copy link

what language is this? I'm guessing Python?

@sapslaj
Copy link
Author

sapslaj commented Aug 18, 2014

@Walkman100 It's Ruby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment