Automatically import of pdf-files via rss

Hi,

I’m searching for a script which automatically imports pdf-files from rss-feeds into DevonThink Pro. I want to receive a feed which is directly linked to pdf-files.

Maybe DT supports that feature and I’m too blind.

JenEthan

Just post (or send me) the URL of the feed and I’ll have a look at it (it should be possible as DT Pro’s script suite is able to parse feeds and to download data).

That’s very kind of you.

The URL is:
bundestag.de/aktuell/RSS/Bundestag_WD.rss

Greetings and many thanks
JenEthan

Here’s the script:


-- Download PDFs of Feed

property pFeed : "http://www.bundestag.de/aktuell/RSS/Bundestag_WD.rss"

tell application "DEVONthink Pro"
	set theXML to download markup from pFeed
	set theItems to get items of feed theXML
	if theItems is not {} then
		try
			activate
			show progress indicator "Downloading..." steps (count of theItems)
			repeat with theItem in theItems
				set theLink to |link| of theItem
				if theLink ends with ".pdf" and not (exists record with URL theLink) then
					set theName to title of theItem
					step progress indicator theName
					set thePDF to download URL theLink
					set theRecord to create record with {name:theName, URL:theLink, type:picture}
					set data of theRecord to thePDF
				else
					step progress indicator
				end if
			end repeat
		end try
		hide progress indicator
	end if
end tell

Many, many thanks!!! It works fine. :laughing: :laughing: :laughing: :laughing: :laughing: :laughing: :laughing: :laughing:

One question: is this script also usable for other pdf-feeds? Do I just have to replace the URL?

JenEthan

You could of course use different scripts with different URLs. Or modify the script to use the currently selected bookmark. Or combine it with the techniques shown by the existing feed scripts (see folder ~/Library/Application Support/DEVONthink Pro/Feeds).