 | |  |
 |

Benjamin
Staff

May 20, 2003, 3:00 PM
Post #1 of 54
(16011 views)
Shortcut
|
Publishcron 1.0 for Article Manager
|
Can't Post
|
|
Hi guys, For all you developers out there, here's a nice little script written by Ken, one of our programmers. What it does is uses your server's cron functionality to dynamically create static HTML pages at predefined intervals from an Article Manager search query. So what possible use would this be...? Well, it can be useful in a variety of different scenarios.... Server-side scripts - by definition - require your server to be actively involved every time that page / script loads. That takes time. And when you have a large site with many scripts and many visitors, you'll want to keep things running quickly and efficiently. Imagine one of your pages includes an SSI that queries your search engine (search.cgi). Since this SSI will return different information depending on the current contents of your database, it has to repeat the same query again and again, using the search.cgi script to return the results. This isn't that efficient - so here's the alternative: instead of having the SSI call the search.cgi script every time, we're going to have it call a static HTML page - and we'll continually recreate this HTML page from the search.cgi script at intervals using a cron job / scheduled task. That's exactly what publishcron does. This script, used in conjunction with the Article Manager SSI Wizard (which creates your actual search query), is actually a very powerful development tool. It can potentially save you your valuable server resources. The attached zip file contains publishcron.txt - which includes installation instructions and how to generate your particular pages. So everyone give a round of applause for Ken! Enjoy! Ben interactivetools.com
(This post was edited by Benjamin on May 20, 2003, 3:00 PM)
|
|
Attachments:
|
publishcron.zip
(5.19 KB)
|
|
|  |
 |

thor
Novice
May 27, 2003, 9:13 AM
Post #2 of 54
(15946 views)
Shortcut
|
|
Re: [Benjamin] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
This is sweet. Just what I am looking for. I do need some direction though. I havent been able to get it to work yet. This is what I was running originally. <!--#exec cgi="/artman/exec/search.cgi?search=1&cat=1&perpage=1&start=1&template=search/custom_template.html"--> How does that translate using publishcron? #page1 = marks_minute.html #query1 = search=1&cat=1&perpage=1&start=1&search/custom_search_results.html&perpage=8 Thanks
|
|
|  |
 |

ken_itools
Staff

May 27, 2003, 10:53 AM
Post #3 of 54
(15936 views)
Shortcut
|
|
Re: [thor] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi thor, Here are a couple of things to check: 1) In the publishcron.ini configuration file, "uncomment" the searchurl, page1 and query1 lines. Do this by simply removing the # character from the beginning of each line. 2) Make sure that you've set the searchurl value to the absolute web path (the same path you type into your web browser) as your exec directory, including the leading "http://". Note that you don't need a trailing slant to finish it off. You should end up with something like: searchurl = http://www.yoursite.com/artman/exec page1 = marks_minute.html query1 = cat=1&perpage=1&start=1&search/custom_search_results.html&perpage=8 Once you've uploaded publishcron.ini, you can see what the published page will look like by visiting something like with your web browser: http://www.yoursite.com/artman/exec/publishcron.cgi?page=1 Finally, when you're satisfied that publishcron.cgi is publishing what you want and expect, you can replace your original exec cgi SSI tag with something like: <!--#include virtual="/artman/exec/marks_minute.html" --> I suggest uploading a test page which contains only the new SSI tag before replacing the existing SSI throughout your public website. Let us know how it works out for you ---------- Ken Clarke - YAPG (Yet Another Perl Guy :) interactivetools.com, inc. Tel: (604)689-3347 - Fax: (604)689-3342 - Toll Free: 1(800)752-0455
|
|
|  |
 |

thor
Novice
May 27, 2003, 11:12 AM
Post #4 of 54
(15930 views)
Shortcut
|
|
Re: [ken] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
DOH! I should kick my own ass for not uncommenting that out. Its looking much better will keep you posted. Thanks so much.....I had so many complaints about speed. T
|
|
|  |
 |

thor
Novice
May 27, 2003, 11:28 AM
Post #5 of 54
(15928 views)
Shortcut
|
|
Re: [thor] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Ken, I have a search template I am using called custom_template.html. Its output is very generic. When i run the publishcron.cgi it seems to use my search template and put the results in another template. Any ideas. I think im just missing something...maybe i need more coffee.... hmmm or just more experience. Thanks
|
|
|  |
 |

Theo
Project Manager
/ Moderator

May 27, 2003, 1:09 PM
Post #6 of 54
(15918 views)
Shortcut
|
|
Re: [thor] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
You want to make sure that your search query has the template attribute, it seems to be missing from the sample you provided: search=1&cat=1&perpage=1&start=1&search/custom_search_results.html&perpage=8 You'll want to change it to search=1&cat=1&perpage=1&start=1&template=search/custom_search_results.html&perpage=8 Ben's SSI Wizard actually includes the query string without the full browser path, making it useful for producing publishcron queries quickly. Plus it allows you to fully test and tweak your query string before dropping it into your publishcron.ini. Theo Wiersma Project Manager
|
|
|  |
 |

thor
Novice
May 27, 2003, 3:08 PM
Post #7 of 54
(15908 views)
Shortcut
|
|
Re: [Theo] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Thanks for all the help I have it all working beautifully. The site is much faster Thanks
(This post was edited by thor on May 27, 2003, 3:12 PM)
|
|
|  |
 |

isac
User
Aug 13, 2003, 4:43 AM
Post #8 of 54
(15727 views)
Shortcut
|
|
Re: [ken_itools] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi, I canīt include files from cgi-bin (ssi). I have a testing server in my laptop with Apache, Perl, Mysql and PHP and all works fine... except calling files to server side include. It is possible to chosse other directory than ./exec or /cgi-bin? Can Someone give me a hand! Thanks Isac
|
|
|  |
 |

Benjamin
Staff

Aug 13, 2003, 11:15 AM
Post #9 of 54
(15722 views)
Shortcut
|
|
Re: [isac] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi Isac, > canīt include files from cgi-bin (ssi). That may well be a security precaution initiated by your server. But yes, SSI's can pull in file from other directories besides the /exec or /cgi-bin! What I'd suggest is moving whatever file you want to pull in to somewhere outside of your cgi-bin and into your webroot, then try pulling it into your page with an SSI like this: <!--#include file='filename.html'--> That will automatically look right in your webroot (i.e. the directory which corresponds to this URL: http://www.yoursite.com). Once this is all working, you could worry about placing the file in the appropriate directory. Hope this helps. Ben interactivetools.com
|
|
|  |
 |

Bob B
User
Aug 13, 2003, 7:49 PM
Post #10 of 54
(15715 views)
Shortcut
|
Re: [Benjamin] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
I put mine in http://mysite.com/inc/ so that I always knew where the files to be included were. How's that?
|
|
|  |
 |

jcocking
User
Sep 8, 2003, 8:35 AM
Post #11 of 54
(15615 views)
Shortcut
|
|
Re: [Benjamin] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
I need to break up by publishcron.ini file into several smaller files. I have exceed 200 queries. My hosting company will allow cron jobs of less than one minute to run hourly. anything over a minute can only run daily. From revieing the publishcron.cgi file, the only reference to the ini file is located in line 42: my %g = ('inifile' => 'publishcron.ini'); If I change this to a different file name will it allow me to run with different ini files? Is there something hidden I am not aware of? I am actually looking at changing the publishcron to a daily and hourly file. I have some items that only need to be ran daily and other items to run hourly. Looking for those gotcha's that a cgi and cron novice might not be aware of. jeff Jeff Cocking Lotus Elan (AM 1.38) VoIP Phone Comparisons (AM 2.02)
|
|
|  |
 |

Benjamin
Staff

Sep 8, 2003, 3:37 PM
Post #12 of 54
(15607 views)
Shortcut
|
|
Re: [jcocking] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi Jeff, Thanks for your post! I'd suggest creating two directories, one to store the daily crons and one for the hourly crons. Each directory would contain it's own copy of the publishcron.cgi and the publishcron.ini. Each .ini file would, of course, contain only those elements which you wanted to be executed at that time. That way you wouldn't have to rename any of the .ini files or edit the publishcron.cgi - which always runs the risk of disabling the script. Since the two publishcron.cgi's are located in different directories, you can enter a separate cron tab entry for each of the two scripts. Hope this helps! Ben interactivetools.com
(This post was edited by Benjamin on Sep 8, 2003, 3:39 PM)
|
|
|  |
 |

jmueller0823
User
Oct 4, 2003, 8:10 PM
Post #13 of 54
(15448 views)
Shortcut
|
|
Re: [Benjamin] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Beautiful solution. Like a previous post, I can't display the "publish" files located in my cgi folder. To make it work, I need to move them to public folder. Does anyone have a solution to "automate" this process [move files]? A cron job is useless when we need to manually move files. Thanks. Jim g r o w t h t r a c dot c o m Life Changing Resources for Your Marriage
|
|
|  |
 |

Donna
Staff
/ Moderator

Oct 5, 2003, 9:49 AM
Post #14 of 54
(15440 views)
Shortcut
|
|
Re: [jmueller0823] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi there! Thanks for your post. :) In general, most people can't display html in their cgi-bin folders. However, you can set Article Manager to publish to any directory on the server in the Setup Options. All you need to do is make the directory writable by Perl, and you can publish to the directory that you want. :) Does this help? It's hard to say exactly what you'll need to change your settings to without looking directly at your server configuration. If you'd like, we can change the publish path for you if you fill out a support request here: https://www.interactivetools.com/support/email_support.cgi I hope this helps! :) Donna
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

jmueller0823
User
Oct 5, 2003, 11:51 AM
Post #15 of 54
(15438 views)
Shortcut
|
|
Re: [Donna] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Donna, thanks for the reply. Sorry, I don't think I was clear... I'm talking about using Publishcron [see the thread above]. When Publishcron is run, it creates the files in my cgi-bin/artman/exec folder. I need the files created in a "non cgi" area. Yes, I know it's possible to configure the "Publish Directory". But Publishcron does not create the files there. Does that help? Jim g r o w t h t r a c dot c o m Life Changing Resources for Your Marriage
(This post was edited by jmueller0823 on Oct 5, 2003, 12:28 PM)
|
|
|  |
 |

Donna
Staff
/ Moderator

Oct 5, 2003, 12:35 PM
Post #16 of 54
(15434 views)
Shortcut
|
|
Re: [jmueller0823] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi there! Ah, I see what you mean. :) What you'll want to do instead is set the filename in the publishcron.ini to the full path of where you want the files published -- the same path that you have set in the setup options of Article Manager, with the filename tagged on the end. For example:
/home/youruser/html/artman/publish/dynamic_search_results.html Or something along those lines. :) I hope this helps! Let me know if you have any other questiosn or concerns. :) Donna
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

jmueller0823
User
Oct 5, 2003, 5:46 PM
Post #17 of 54
(15429 views)
Shortcut
|
|
Re: [Donna] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
That did it. Thank you. Jim g r o w t h t r a c dot c o m Life Changing Resources for Your Marriage
|
|
|  |
 |

pabloho
New User
Jan 26, 2004, 6:37 PM
Post #18 of 54
(14673 views)
Shortcut
|
|
Re: [jmueller0823] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi I modified The Publishcron.ini file as follows, but I get a 500 internal server when I run this URL from my Browser: http://www.yoinfluyo.com/cgi-bin/artman/exec/publishcron.cgi Any Ideas why this could be happening? I think the script is working fine... # ---------------------------------------------------------------------------- # Publishcron.ini for Article Manager Publishcron.cgi # Publishes search.cgi queries into static files for includes # Copyright (C) 2003 interactivetools.com, All Rights Reserved # http://www.interactivetools.com/ # ---------------------------------------------------------------------------- #--------Search URL searchurl = http://www.yoinfluyo.com/cgi-bin/artman/exec #--------Search Queries page1 = /home/virtual/site3/fst/var/www/html/rapida1.shtml query1 = search=1&perpage=1&cat=36&start=1&template=search/frase.htm page2 = /home/virtual/site3/fst/var/www/html/rapida2.shtml query2 = search=1&perpage=1&cat=49&start=1&template=search/search_cuadros.htm page3 = /home/virtual/site3/fst/var/www/html/rapida3.shtml query3 = search=1&perpage=1&cat=26&template=headlines/default_sem_home.htm page4 = /home/virtual/site3/fst/var/www/html/rapida4.shtml query4 = search=1&perpage=1&cat=35&template=headlines/default_bullets_home.htm page5 = /home/virtual/site3/fst/var/www/html/rapida5.shtml query5 = search=3&perpage=3&cat=22&template=headlines/default_bullets_home.htm page6 = /home/virtual/site3/fst/var/www/html/rapida6.shtml query6 = search=3&perpage=3&cat=16&template=headlines/default_bullets_home.htm page7 = /home/virtual/site3/fst/var/www/html/rapida7.shtml query7 = search=1&perpage=1&cat=25&template=search/search_carica.htm
|
|
|  |
 |

Cliff
Staff

Jan 27, 2004, 11:36 AM
Post #19 of 54
(14631 views)
Shortcut
|
|
Re: [pabloho] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi pabloho Thanks for posting. When you are using Publishcon, you are actually using the script to create static pages. So if you want to view the results of a specific page, you can do a direct query to that page http://www.yoinfluyo.com/cgi-bin/artman/exec/publishcron.cgi?page=3. When you run the Publishcron.cgi script, it runs through all the search querys that you have setup, and creates the pages that you need. So you get a static page for page 3, and so on. From what I can see, it looks like your Publishcron is working perfectly Theo has a really great post about imbedding the Publishcron feature into the interface template. Here is the link for you: http://www.interactivetools.com/forum/gforum.cgi?post=13224#13224 Let me know if you have any additional questions! Regards, Cliff Stefanuk - Customer Service Manager support@interactivetools.com
(This post was edited by Cliff on Jan 27, 2004, 11:38 AM)
|
|
|  |
 |

zakcoop
User
Feb 27, 2004, 12:53 PM
Post #20 of 54
(14321 views)
Shortcut
|
|
Re: [Cliff] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Is it possible to run publicron.pl and pass variables to it so that it will write an html file of search results on the fly? For instance www.mydomain.com/cgi-bin/artman/exec/publishcron.pl?page250=/mysearchresults.html&query250=search=keyword ... I am asking this because I am using a Flash interface for our site and would like to simply write search results to a text file on the fly so that I can then pull that html file into the Flash SWF to display the search results - thus keeping the user inside of flash rather than opening a new mandatory html interface for the search results. We are using artman to manage ALL the content within our Flash web site under development and it's working great. I just need a way to pull in search results for visitors. Best Regards, Aaron
|
|
|  |
 |

Cliff
Staff

Feb 27, 2004, 5:28 PM
Post #21 of 54
(14313 views)
Shortcut
|
|
Re: [zakcoop] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi Aaron Thanks for posting! You can certainly pass query string variables to get a custom html page on the fly. If you take a look at what pabloho was doing, you can see that he is using a custom search query to call the specific categories and templates to use. If you follow the instructions in this post you can setup Article Manager to automatically update your HTML page for you. Publishcron is a really great tool once you get it up and running. If you need any help along the way, just post again! Regards, Cliff Stefanuk - Customer Service Manager support@interactivetools.com
|
|
|  |
 |

zakcoop
User
Feb 28, 2004, 4:05 AM
Post #22 of 54
(14305 views)
Shortcut
|
|
Re: [Cliff] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Cliff, Thank you for such a quick response - appreciated! I'm not sure you answered the full question? I have been using publishcron.pl successfully for about 2 months now within our prototype to generate html files that are pulled into the flash files (see: www.hga.com/prototype), however, when I said "on the fly" I meant truly "on the fly." I noticed pabloho's posting that simply appends the ?page= ... onto the end of the publishcron.pl URL, however all that does is call a previously coded function within the publishcron.ini file. That doesn't build a new query on the fly. I am looking to actually pass the full query to publishcron.pl within the URL so that I can grab the variables from a Flash form and simply call the URL to have it write the results to html on the fly. I think you see why this is necessary since I can't possibly anticipate the millions of possible searches that someone would create by hardcoding "page1, page2, page3" into the publishcron.ini file, then call those upon searching. I really just need to know if it's possible to truly use publishcronn on the fly via a URL string. And, if so, what is the URL format I should use. For instance, if I used a format like the following could I paste this into a browser and, whala!, have a "search_results.html" file generated on the server with the search results?: http://www.mydomain.com/cgi-bin/artman/exec/publishcron.pl?page=../../searchtemp/search_results.html&search=1&cat=1&perpage=1&start=1&template=search/custom_search_results.html&perpage=8 thanks so much, Aaron
(This post was edited by zakcoop on Feb 28, 2004, 4:09 AM)
|
|
|  |
 |

Cliff
Staff

Mar 1, 2004, 4:11 PM
Post #23 of 54
(14275 views)
Shortcut
|
|
Re: [zakcoop] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi Aaron, Thanks for the additional details. I doesn't look like Publishcron is going to be able work in the way that you indend. The main problem is that Publishcron was not desinged to have search query variables passed directly to it like you are mentinoning. The only thing that was ment to be passed was the page= value. So while Publishcron will still give you the static pages that you need, you are going to have to add a search query and the publish path and name of the page everytime that you need a new page. I hope the helps clarify things for you. Regards, Cliff Stefanuk - Customer Service Manager support@interactivetools.com
|
|
|  |
 |

halkibsi
User
Apr 5, 2004, 12:31 AM
Post #24 of 54
(13862 views)
Shortcut
|
|
Re: [Benjamin] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
can publishcron generate static weekly pages? lets say you have articles posted into the site between April 4th - April 11th. Can you set publishcron to publish those articles every 7 days? and publish another page that updates ONE static page (lets call its archives.html) with the new dates? ARCHIVES.HTML will look like this: March 29, 2004 April 04, 2004 April 11, 2004 If you would click on April 04, 204, you would go to the April 04, 2004 archives page (maybe named archive_april_04_2004.html). this page will have the 7 days asrticle list that were visible on the site. If so, how do we do that? if not, can another publishcron type script be programmed to do this? Cheers! Haitham halkibsi@mtiaz.com http://www.mtiaz.com
(This post was edited by halkibsi on Apr 5, 2004, 12:35 AM)
|
|
|  |
 |

Donna
Staff
/ Moderator

Apr 5, 2004, 5:39 PM
Post #25 of 54
(13842 views)
Shortcut
|
|
Re: [halkibsi] Publishcron 1.0 for Article Manager
[In reply to]
|
Can't Post
|
|
Hi Haitham, Publishcron is only designed to overwrite the same file with different content at a designated time. So, I don't believe it would be possible to create weekly archives without some manual modifications every week to tell it to create different files. It's designed to be a replacement for using the search engine to display specific dynamic content. Currently, we're not taking on any custom programming, so we wouldn't be able to create a script like this at the moment either. However, I'll add this to our requested features list. :) Donna
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
|