How can you get information about what apps you have and what you've spent on them?
- Look at the files in the "Mobile Applications" folder.
- Print from the Apps view in iTunes (use the Song listing option to get the most information).
- Use Spentonapps (I'm sure you're very enthusiastic about giving them your email and password so they can comb through your email account.)
- Look at your purchase history via iTunes 20 purchases at a time.
- Do some tedious email-mining.
Naturally, I choose the most tedious method.
I searched my gmail for iTunes receipt messages and applied a label to them. I don't usually store my email locally, so I set up gmail and apple's mail client to IMAP sync only one of my gmail labels (it would take way too long to download all messages). I figured out how to do this thanks to a comment by Matt at StackExchange:
if you have a lot of email, turn on the "Advanced IMAP Controls" Labs feature, then, under "Manage Labels", turn off IMAP access for all the folders except the one you want to download.Thanks Matt! Once I had searched for the iTunes receipt messages, I applied a label to them and downloaded only those messages.
Next, I selected all the messages and saved them as plain text in a file called "receiptPlainText.txt". Then, some nasty bash:
cat receiptPlainText.txt | grep -v "Order Total:" | grep -B1 -A1 "Report a Problem" >purchasesOnly.txt
b=`cat purchasesOnly.txt | grep -v "Report a Problem"| sed 's/^Free/\$0.00/' | sed 's/, v[^,]*//' | tr -d ","`
echo $b | tr -d "*" | sed 's/ -- /\*/g' | tr "*" "\n" | grep "Seller"| sed 's/ Seller:/HBPH/' | sed 's/ \$\([0-9\.]\{4\}\)/, \1/g' | sed 's/HBPH/,/g' | sed 's/^/\"/' | sed 's/$/\"/' | sed 's/, /\", \"/g' >appPurchases.csv
The breakdown:
grep -v "Order Total:"
- remove prices that are totals
- identify regions of text that are individual purchases
b=`
- remove newlines by saving the text as a variable
- remove unneeded line
- make line structures comparable
- remove version info
- remove commas
- remove any asterisks in app names
- put a marker between records
- replace marker with newline
- remove records that aren't apps (all apps have sellers)
- replace Seller with marker for comma insertion
- insert comma before price; remove $
- replace marker with comma
- put quotes around each field
I analyzed my data, and wow, I've bought a lot of apps. I couldn't bear to leave the left axis on, sorry.
It would be nice to have the date purchased too.
No comments:
Post a Comment