LoginSignup
0
0

More than 5 years have passed since last update.

AppStore, Google Play Store から アプリ固有のidを抜き出す

Posted at

業務でAppStore (iOS), Google Play Store (Android) からアプリ固有のidを抽出する必要があったため備忘録です。Perlでの記述になりますが、正規表現なので他の言語でもほぼ変わらないかと

Google Play Store (Android)

my $android_url = 'https://play.google.com/store/apps/details?id=com.ea.game.maddenmobile15_row&hl=ja';

# 'details?id=bundle& : details?id= に続きかつ、[^&]+ で &を含まないような文字列
print $android_url =~ /details\?id=([^&]+)/ ? "$1\n" : undef; 
$ perl android_extract_id_from_url.pl
com.ea.game.maddenmobile15_row

App Store (iOS)

my $ios_url = 'https://itunes.apple.com/us/app/yelp/id284910350?mt=8';

# id に続く数列
print $ios_url =~ /id(\d+)/ ? "$1\n" : undef;
$ perl ios_extract_id_from_url.pl
284910350
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0