Parsing emails, rss-feeds, Websites for itunes-links and download them

Howdy… it’s the Try & Error guy again :wink:

I wonder if it is possible with applescript to check emails, rss-feeds or websites (in intervalls (realized by cron-jobs)) for ituneslinks from the US-Store?

Reason: Itunes gives away free songs/music-videos every week (one or more) and searching them every week is very…ehm… you know :wink:
I found a website, http://www.itsfreedownloads.com/, that gives you links to the free songs & musicvideos. That helps me, and I think some other people too, to get to know some new music.

The iTunes-Links always have - obviusly - the same format like:
http://phobos.apple.com/WebObjects/MZStore.woa/wa/[u][b]viewVideo[/b][/u]?id=292746652&[u][b]s=143441[/b][/u]
the underlined parts in the URL are 1. type of media (music/video), 2. the iTunesStore (the US-Store in this case)

The RSS-feed always uses, as far as I could see, “Songs Free on iTunes” for promoting the free songs and videos in the US-iTunesStore.

I think the email are based on a similar linking principle but I am not sure about that right now (just subscribed the newsletter).

So back to the Question. Is it possible to look only for links that have specific “tags” in it like s=143441 (for the US-Store) and viewVideo/viewAlbum and then to download these?

I know that there are some widget around but you still have to download the songs by yourself…

Thank you very much for any useful and helping comments on this :wink:

goeste

Hi goeste,

This thread already shows how to retrieve HTML links from a website/document. Once you have a list of URLs, you can easily find out if they contain certain characters sequences:


set theURLs to {"http://www.felixgoestemeyer.de", "http://www.joyofscripting.com", "http://www.apple.com"}

repeat with theURL in theURLs
	if theURL contains ".de" and theURL contains "felix" then
		--do something
		log theURL
	end if
end repeat

You can download files with the curl command or URL Access Scripting (example).

Merci monsieur, how the french would say.

I´ll give it a try when I´m back from work. Thank you :slight_smile: