Last active
December 18, 2015 00:18
-
-
Save sasha1sum/5695567 to your computer and use it in GitHub Desktop.
Script to take a package name and return it's title from play.google.com. Also a script which takes a filename with a list of packages and uninstalls them.
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
#!/usr/bin/ruby | |
require 'nokogiri' | |
require 'open-uri' | |
class PlayEntry | |
def initialize(package) | |
@package = package | |
url = "https://play.google.com/store/apps/details?id=#{package}" | |
@doc = Nokogiri::HTML open(url) | |
rescue | |
@doc = Nokogiri::HTML "" | |
end | |
def title | |
node = @doc.css("h1.doc-banner-title").first | |
node.text unless node.nil? | |
end | |
end | |
ARGV.each do |package| | |
package = package.strip | |
entry = PlayEntry.new package | |
puts "#{entry.title}\t(#{package})" | |
end |
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
#!/usr/bin/ruby | |
# takes a filename which contains a list of packages to uninstall | |
File.open(ARGV.first).each do |package| | |
package = package.strip | |
print "Uninstalling #{package}..." | |
STDOUT.flush | |
puts `adb uninstall #{package}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment