The Apple Geek

Чему ты научился сегодня?

Стоит ли переключаться с российского iTunes Store на украинский или поиск отсутствующих программ

Есть ли жизнь на Марсе? Этот вопрос чисто академический. Все ли купленные мной программы есть в открывшемся сегодня iTunes Store Ukraine и стоит ли на него переходить? А это уже практический и волнующий владельцев iPhone и iPad из Украины вопрос.

Я уже сталкивался с тем, что в iTunes Russia не было некоторых программ, прекрасно себя чувствовавших в iTunes USA. Поэтому я преодолел первый порыв переключиться на iTunes Store Ukraine.

Перебирать программы вручную было лень, потому как пришлось бы вручную вбить 92 программы в iTunes Store:

Писать полноценную программу тоже не хотелось, ведь это получение ответа на единственный вопрос. Поэтому написал одну строку в shell. Без проверки ошибков и красивых обёрток. Воспользовавшись отработанным ранее приёмом ”Получение информации по приложениям iPhone в iTunes из shell” и интерфейсом к Search API iTunes.

Команда (вам нужно поменять в начале строки /Volumes/Data/Music/iTunes Music/Mobile Applications на путь к вашему каталогу “Mobile Applications”). Также можно заменить страну в переменной itsCountry, взяв её из списка ISO-кодов.

itsDir="/Volumes/Data/Music/iTunes Music/Mobile Applications"; itsCountry="UA"; if [ ! -d "$itsDir" ]; then echo "Directory for Mobile Applications does not exist"; else find "$itsDir" -type f -name \*ipa -print0 | while IFS="" read -r -d "" file ; do res=$(unzip -p "$file" iTunesMetadata.plist | plutil -convert xml1 - -o - | grep -A1 -e itemName -e itemId | grep -e 'integer' -e 'string' | sed -e 's/^.*//' -e 's/^.*//' -e 's/<.*$//' | tr '\n' ';'); id=$(echo "$res" | cut -d ';' -f 1); name=$(echo "$res" | cut -d ';' -f 2); result=$(curl "http://itunes.apple.com/lookup?country=$itsCountry&id;=$id" 2> /dev/null | grep resultCount | cut -d : -f 2 | sed 's/,//');  printf "%s\t%s\t%s\n" "$id" "$result" "$name"; done; fi;

Формат вывода: первая колонка - itemId, вторая - есть ли программа в UA iTunes Store, третья - её название.

Развёрнутый вариант:

#!/bin/bash
itsDir="/Volumes/Data/Music/iTunes Music/Mobile Applications"
itsCountry="UA"
if [ ! -d "$itsDir" ]; 
then 
    echo "Directory for Mobile Applications does not exist"
else
    find "$itsDir" -type f -name \*ipa -print0 | \
    while IFS="" read -r -d "" file ;
    do
        res=$(unzip -p "$file" iTunesMetadata.plist | plutil -convert xml1 - -o - | \
            grep -A1 -e itemName -e itemId | grep -e 'integer' -e 'string' | \
            sed -e 's/^.*//' -e 's/^.*//' -e 's/<.*$//' | \
            tr '\n' ';');
        id=$(echo "$res" | cut -d ';' -f 1);
        name=$(echo "$res" | cut -d ';' -f 2);
        result=$(curl "http://itunes.apple.com/lookup?country=$itsCountry&id;=$id" 2> /dev/null | \
            grep resultCount | cut -d : -f 2 | sed 's/,//');
        printf "%s\t%s\t%s\n" "$id" "$result" "$name"
    done 
fi

Результат неутешительный. Нет многих программ, которые я использую ежедневно. Вывод - пока переключаться нельзя, стоит подождать.

319898689    1   1Password Pro
427276530   1   AirPort Utility
410592976   1   Wolfram Algebra Course Assistant
388497605   0   Google Authenticator
343938310   1   Billings Touch
367003839   1   Booking.com Hotel reservations for 215,000+ hotels
482063361   1   Byword
376694347   1   Calcbot — The Intelligent Calculator
329670577   0   Camera+
375295479   1   Carcassonne
415408192   1   CarTunes Music Player
304603074   1   CashTrails - Income and Expense Tracker
303491945   1   Comics
290527470   1   Currency Converter HD - Money Exchange Rates
421706526   1   Day One (Journal/Diary)
312088272   0   Dictionary Universal
327630330   1   Dropbox
364203371   1   eBay for iPad
510430668   1   Official UEFA EURO 2012 app
281796108   1   Evernote
398081659   0   Everyday
466122094   1   Find My Friends
376101648   1   Find My iPhone
306934924   1   foursquare
339003573   1   Gloss.ua
448618544   1   GPSies+
376302649   0   Animated Knots by Grog
342115564   1   Hipstamatic
410370669   1   Honk - Find Car, Parking Meter Alarm and Nearby Places
364709193   1   iBooks
348529501   1   iCacti - Server Monitor
407417097   1   iFixit: Repair Manual
492589053   1   Планета Кино IMAX
342792525   1   IMDb Movies &
420368235   1   Instacast
288545208   1   Instapaper
287765826   1   iSSH - SSH / VNC Console
490217893   1   iTunes U
302584613   0   Kindle – Read Books, Magazines &
288429040   1   LinkedIn
352861751   1   Linode Manager
438441429   1   ЛитРес:
347019672   0   Momento (Diary/Journal)
340173808   0   Eastern Europe - iGO primo app
318103548   1   Occasions: Birthdays &
284885288   1   OmniFocus for iPhone
383804552   1   OmniFocus for iPad
375589283   1   Parcel
300311831   1   PCalc Lite Calculator
298055896   1   Pingdom
379873499   0   Pixelogic for iPad - Picross Enhanced
406513617   0   Google Places
409793190   0   Powderful
326277589   1   Privat24
421507115   1   Prompt
368494609   1   QR Reader for iPhone
327870903   1   Rackspace Cloud
398011800   1   Jamie's Recipes
429590524   1   Reddit Pics HD
375661689   1   Reeder for iPad
325502379   1   Reeder
284417350   1   Remote
298398207   1   Road Trip • MPG, Mileage and Fuel Economy
385824712   1   Safari To Go
411206394   1   Scan
400012962   1   Screens VNC
289429962   1   Simplenote
304878510   1   Skype
337013987   1   Urban Dictionary by Slango
320606217   1   Sleep Cycle alarm clock
348142037   1   Soulver - the notepad calculator
355554941   1   SoundHound
300704847   1   Speedtest.net Mobile Speed Test
476500832   0   SpellTower
447067819   1   Sygic Україна: GPS навігація
345571518   0   English Grammar in Use Tests
417817520   0   Tiny Wings
471857988   0   Ticket to Ride Pocket
428851691   1   Tweetbot — A Twitter Client with Personality for iPhone
392501688   1   Verbs IM
364824944   1   Web Albums HD for Picasa
293642937   1   Weightbot — Track your Weight in Style
310633997   1   WhatsApp Messenger
313877526   1   Yandex.Maps
286419912   0   You're #1 — Speed Dial
364297166   1   Zinio - Your Magazine Newsstand. Explore, Read, Shop from thousands of magazines worldwide.
454781476   0   Zombieville USA 2
318556039   1   Авто-Помощник Лайт
477098256   1   Антиштраф
477718890   1   КиноПоиск
520797969   0   Яндекс.Музыка
397682052   1   Правила дорожнього руху України

Вариант команды с выводом цены (NaN = нет информации, нужно поменять страну в начале строки в переменной itsCountry на “RU” или “US”):

itsDir="/Volumes/Data/Music/iTunes Music/Mobile Applications"; itsCountry="UA"; if [ ! -d "$itsDir" ]; then echo "Directory for Mobile Applications does not exist"; else find "$itsDir" -type f -name \*ipa -print0 | while IFS="" read -r -d "" file ; do res=$(unzip -p "$file" iTunesMetadata.plist | plutil -convert xml1 - -o - | grep -A1 -e itemName -e itemId | grep -e 'integer' -e 'string' | sed -e 's/^.*//' -e 's/^.*//' -e 's/<.*$//' | tr '\n' ';'); id=$(echo "$res" | cut -d ';' -f 1); name=$(echo "$res" | cut -d ';' -f 2); curlOut=$(curl "http://itunes.apple.com/lookup?country=$itsCountry&id;=$id" 2> /dev/null); result=$(echo "$curlOut" | grep resultCount | cut -d : -f 2 | sed 's/,//'); price=$(echo "$curlOut" | grep -i price | head -1 | sed 's/^.*"price"://' | sed 's/,.*$//'); if [ "$price" = "" ]; then price="NaN"; fi; printf "%s\t%s\t%5s\t%s\n" "$id" "$result" "$price" "$name"; done; fi

И развёрнутый вариант:

#!/bin/bash
itsDir="/Volumes/Data/Music/iTunes Music/Mobile Applications"
itsCountry="UA"
if [ ! -d "$itsDir" ]; 
then 
    echo "Directory for Mobile Applications does not exist"
else
    find "$itsDir" -type f -name \*ipa -print0 | \
    while IFS="" read -r -d "" file ;
    do
        res=$(unzip -p "$file" iTunesMetadata.plist | plutil -convert xml1 - -o - | \
            grep -A1 -e itemName -e itemId | grep -e 'integer' -e 'string' | \
            sed -e 's/^.*//' -e 's/^.*//' -e 's/<.*$//' | \
            tr '\n' ';');
        id=$(echo "$res" | cut -d ';' -f 1);
        name=$(echo "$res" | cut -d ';' -f 2);
        curlOut=$(curl "http://itunes.apple.com/lookup?country=$itsCountry&id;=$id" 2> /dev/null);
        result=$(echo "$curlOut" | grep resultCount | cut -d : -f 2 | sed 's/,//');
        price=$(echo "$curlOut" | grep -i price | head -1 | sed 's/^.*"price"://' | sed 's/,.*$//');
        if [ "$price" = "" ];
        then
            price="NaN"
        fi;
        printf "%s\t%s\t%5s\t%s\n" "$id" "$result" "$price" "$name"
    done 
fi

Comments

Этот домен продается здесь: telderi.ru, и еще много других