Skip to content

Instantly share code, notes, and snippets.

@satyr
Created March 7, 2009 00:34
Show Gist options
  • Select an option

  • Save satyr/75157 to your computer and use it in GitHub Desktop.

Select an option

Save satyr/75157 to your computer and use it in GitHub Desktop.
if $*.empty?
puts "usage: #$0 commands1 [, commands2, ...]"
exit 1
end
$*.each do |file|
@cmd = "file:///#{file.tr ?\\, ?/}"
@apd = `echo %appdata%`.strip.tr ?\\, ?/
@dbf = Dir.glob("#@apd/Mozilla/Firefox/Profiles/*/ubiquity_ann.sqlite").first
@stt = 'insert or replace into ubiquity_annotation_memory'
{ autoupdate: true, commands: @cmd,
confirmed: true, type: :commands }.each do |key, val|
print `sqlite3 #@dbf "#@stt values('#@cmd','ubiquity/#{key}','#{val}')"`
exit 1 if $?.exitstatus != 0
end
puts "Subscribed: #@cmd"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment