I am new to the Devon suite of programs, but have jumped in with both feet. I am trying to duplicate some Google Alerts functionality using the enhanced search capabilities of DA. Essentially, I have a series of six predefined searches that Google runs and presents each searches results as an RSS feed which I read in Reeder.
I have set up a search set in DA for each of the searches I want to run, but the RSS feature doesn’t make sense to me. I finally figured out where it was putting the RSS file (Documents/DevonAgent RSS/ folder for those still looking). However, it appears to add a new RSS file each time it runs the search. Plus, Reeder doesn’t seem to like the file DA outputs and won’t open it. What program opens this file and how do I use it? It would seem to be more logical that DA would create a RSS file for each search set and then append that file each time the search is run. That way, I could keep track of what results I have read and which are still left to be read.
Can someone please help me with some best practices on how to use the outputted RSS file? I can feel in my bones that there is a tremendous potential here, but I haven’t found the solution yet.
The next release will include this enhanced script:
on results(theResults, theSet, theQuery)
tell application "DEVONagent"
set pathToAdditions to ((path to application id "com.devon-technologies.agent" as string) & "Contents:Resources:Script Additions.scpt") as alias
set helperLibrary to load script pathToAdditions
set this_RSS to "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rss version=\"2.0\"><channel><title>" & helperLibrary's convertText2XML(theQuery) & "</title><generator>DEVONagent 3</generator>"
repeat with theResult in theResults
set this_RSS to this_RSS & "<item><title>" & helperLibrary's convertText2XML(|Title| of theResult) & "</title><description>" & helperLibrary's convertText2XML(|Text| of theResult) & "</description><link>" & helperLibrary's convertText2XML(|URL| of theResult) & "</link>"
set this_date to |pubDate| of theResult
set this_RSS to this_RSS & "<pubDate>" & helperLibrary's convertText2XML(this_date) & "</pubDate>"
set this_RSS to this_RSS & "</item>" & return
set this_RSS to this_RSS & return & "</channel></rss>"
set this_path to ((path to sites folder) as string) & "rss:"
do shell script "mkdir " & quoted form of POSIX path of this_path
set this_file to helperLibrary's replaceText(theSet, " ", "_")
set this_file to helperLibrary's replaceText(this_file, "/", "-")
set this_file to this_file & ".rss"
do shell script "echo " & quoted form of this_RSS & ">" & quoted form of POSIX path of (this_path & this_file)
This script creates the .rss files in the folder ~/Sites/rss and uses the name of the set. After enabling web sharing, a feed can be accessed via e.g. 127.0.0.1/rss/mysearchset.rss
OK, this used to work and now not so much. When I go into DTP and select Data->New–>Feed, I input the URL as 127.0.0.1/rss/nameoffeed.rss and leave the name of the feed set to Automatic (in DTP, not the URL). It comes back and changes the name to “404 not found”.
I know the web sharing is working - going to 127.0.0.1 in Safari yields an “It Works” notice. I know the DA-generated rss document is in the right folder. I just can’t get it to pull it into DTP.
Incidentally, I have also tried to pull these feeds into ReadKit and it fails in that as well. Am I missing something here???
I can point my browser to the local ip address (127.0.0.1) and get the It Works page (even after clearing browser cache). That would tell me that the apache server is putting out pages. It just doesn’t want to put this one out…
Does anyone know why this script might only work for some search sets? I have a few search sets where it works beautifully. However, I can copy that search set, rename it, change a search term (change nothing else) and it won’t create a .rss file.
I thought creating a search set from scratch was the answer, and it was for a while. Yesterday I created a new set from scratch and it now won’t create an .rss file for that set. All of the others continue to work as they had previously.
Is there a trick here I am missing?
Also, it possible to “pretty up” the formatting of the produced .rss results with some formatting?
The search works exactly as expected within DA. It generates results, displays a notification and adds the results to an archive. That part is working very well. It’s just the RSS to site part that has trouble.
Hmmm… I went to go run the search manually to get you the Console information and it now appears to have established an .rss file in the correct directory. I had to reboot my machine this AM for an unrelated program install. Is it possible that rebooting DA somehow triggered it to work?