 | |  |
 |

MikeB
Staff
/ Moderator

May 17, 2006, 4:32 PM
Post #1 of 32
(18603 views)
Shortcut
|
|
Add-on: autopublish.cgi 1.0
|
Can't Post
|
|
Hi Everyone The ability to hide articles and have them published at a later date is something we get requests for quite often so I've created an autopublish.cgi script that will do just that. In this forum post I'll outline a few details about how this works and you can download the attached autopublish_1_0.zip file. Contained in the zip file is an autopublish.cgi file and an autopublish.txt readme. In this forum post I've kept a couple of the more technical details a bit brief as there is more detail in the autopublish.txt file. What is autopublish.cgi? This script is designed to allow you to set articles to be published at a later date. This means that each day, when you run this script it will check if any articles should be published on this day. It will set these hidden articles to "Visible" and will re-publish your Article Manager content. How do I set up my articles to use autopublish.cgi? The first step to start using autopublish.cgi is to create a new field within Article Manager's Setup Options. The script is defaulted to use art_field19 but if you'd like to use something else you can easily change this. You can call this field "Auto Publish at a later date?" and make the field a dropdown menu with options "No" and "Yes". This means that in the "field name" box, you'll have this: Auto Publish at Later Date? (No, Yes) Be sure to set this as a "pulldown" and click the enabled checkbox. Also, make a note of the field number that you're using (art_fieldX). To have an article be auto-published at a later date it needs to meet three distinct criteria, the article must be set to "Hidden", the new "Auto Publish?" field must be set to "Yes" and the article's Month, Day and Year dropdown menus need to be set for the day you'd like the article to be published on. How do I install autopublish.cgi? Now that the ground work has been set up for your articles you'll want to put the autopublish.cgi file on the server. Full details about uploading and running autopublish.cgi can be found in the autopublish.txt readme file. To install the autopublish.cgi script there are three basic steps: 1) Open autopublish.cgi on your local computer (in a basic text editor) to modify a few user-defined values. 2) Upload autopublish.cgi into your /artman/exec/ directory 3) Make the file world executable (chmod 755) How do I run autopublish.cgi? There are a couple of ways to run autopublish.cgi and this is a quick overview of the different methods: 1) You can run autopublish.cgi manually through your browser. Because this is something that you'll only be doing once a day (at most) it shouldn't be too time-consuming to run it manually through the browser. You would want to use a URL that looks like this: http://yoursite.com/cgi-bin/artman/exec/autopublish.cgi?id=USERNAME&pw=PASSWORD You'll want to ensure that "USERNAME" and "PASSWORD" are the details for the administrator as this will be required to access the admin program's Setup Options to re-publish your articles. 2) You can set up a link within Article Manager to run autopublish.cgi from the Setup Options. You would basically add the URL from option 1 above as a link. In the autopublish.txt file there is more detail about how and where to add this code. 3) Depending on the way your server is set up you may be able set up this script to run as a Cronjob at a predetermined time that works well for you (once a day, once a week, etc.) Note: autopublish.cgi does run Article Manager's "Publish All" once the status of the articles has been changed. This means that the amount of time this script takes to complete should be comparable to the amount of time a "Publish All" takes on your site (with just a few added seconds depending on the amount of articles). Also, this script has currently only been tested on version 1.41 of Article Manager. I hope you find this helpful and if you have any questions or comments about this script just let me know! Cheers, Mike Briggs - Product Specialist support@interactivetools.com
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.
(This post was edited by MikeB on May 18, 2006, 4:38 PM)
|
|
Attachments:
|
autopublish_1_0.zip
(15.5 KB)
|
|
|  |
 |

bonnie72
User
May 20, 2006, 1:55 PM
Post #2 of 32
(18550 views)
Shortcut
|
|
Re: [MikeB] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi Mike, That sounds cool! One question about Autopublish though. I have 5 news articles (summaries) on my news index page. When I create 2 new articles and I choose a future date for them, will there still be 5 articles on my index page, or just 3 until the hidden articles show up? Thanks, Marco
(This post was edited by bonnie72 on May 20, 2006, 1:56 PM)
|
|
|  |
 |

MikeB
Staff
/ Moderator

May 20, 2006, 2:47 PM
Post #3 of 32
(18547 views)
Shortcut
|
|
Re: [bonnie72] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi Marco, Thanks for posting! Because this script directly modifies Article Manager's data file and the articles will be set to hidden within the admin program, you will still have 5 articles displaying on your index page. Then, in your example, when your two hidden articles are made visible and published to the site the program will act as if you had just written the articles and will update the index page accordingly. To see the effect you could essentially just create a new article and set it to "Hidden". Then, take a look at your site, you won't see any missing content and you'll still see 5 headlines on your index page but you won't be able to find this article anywhere (not on the index page and not accessible through the search). This autopublish.cgi script will just take this hidden article and make it visible so people can view it on your site. I hope this helps but if you have any other questions or comments about this add-on, just let me know! Cheers, Mike Briggs - Product Specialist support@interactivetools.com
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.
|
|
|  |
 |

bonnie72
User
May 21, 2006, 1:21 AM
Post #4 of 32
(18537 views)
Shortcut
|
|
Re: [MikeB] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
This is excellent, I'm sure many AM users will find this add-on a great tool! Marco
|
|
|  |
 |

webgroup
User
Jun 24, 2006, 6:13 PM
Post #5 of 32
(18305 views)
Shortcut
|
|
Re: [bonnie72] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Thanks!!!!! But I have a problem making the script work via cronjob. The system is not accepting the USER and PASS strings, if I put the user and pass in the string it won't work. If I remove the user and pass then it says that you need to add it. EX: Can't open perl script "/home/site1/public_html/cgi-bin/exec/autopublish.cgi?id=myuserid": No such file or directory That's using the user and pass. As soon as I remove the user/pass from the string in the cronjob: Content-type: text/html <style type="text/css"><!-- body, td { font-family: arial; font-size: 12px; } --></style> Please add your Username and Password for Article Manager to the query string. The URL should look like this: <BR> autopublish.cgi?id=username&pw=password Please help. Thanks!
(This post was edited by webgroup on Jun 25, 2006, 3:27 AM)
|
|
|  |
 |

MikeB
Staff
/ Moderator

Jun 26, 2006, 4:50 PM
Post #6 of 32
(18255 views)
Shortcut
|
|
Re: [webgroup] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi webgroup, Thanks for the post and for trying out this script! It sounds to me like this just has to do with the way your server is set up to run cronjobs. I've done a bit of research and I've noticed that using a path like this can cause issues on some servers: /home/site1/public_html/cgi-bin/exec/autopublish.cgi?id=myuserid In some cases the server will actually look for a file called "autopublish.cgi?id=myuserid" rather than looking for a file called "autopublish.cgi" and passing the "id=myuserid" attribute. I'd suggest getting in touch with your hosting company to see if they have any suggestions on how you can set up a cronjob to read the username and password as attributes rather than part of the file name. In some cases I've noticed that using the "cURL" command on your server will allow the attributes to be treated as part of a query string rather than a filename. This means you'd replace the path that you're currently using and you'd actually use something like this: /usr/bin/curl "http://www.yoursite.com/cgi-bin/exec/autopublish.cgi?id=myuserid&pw=yourpassword" As I mentioned, although this will probably be similar to the format you'll end up using, you'll definitely want to talk to your hosting company to see if they have any details about the specific syntax you can use. I hope this helps and if you have any other questions feel free to let me know! Cheers, Mike Briggs - Product Specialist support@interactivetools.com
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.
|
|
|  |
 |

webgroup
User
Jun 27, 2006, 6:28 AM
Post #7 of 32
(18234 views)
Shortcut
|
Re: [MikeB] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Yep! That was it! Working fine now!! Thanks a lot.
|
|
|  |
 |

abbydabby
New User
Jun 27, 2006, 12:08 PM
Post #8 of 32
(18225 views)
Shortcut
|
|
Re: [MikeB] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
I downloaded the autopublish add on and installed it. I am getting "Am Error Occured" 502 Gateway Error Could not connect to server. However, the data file is modified from Hidden to visible, but the article does not display unti I open it up manually and the save it. Notes: I was running on Version 1.21 - I upgraded the system because I thought that was the problem. That resolved a filelock issue that I had initially with autopublish. However, now I am on 1.41 and still am having the problem. I am running on a windows 2003 server. (IIS)
|
|
|  |
 |

MikeB
Staff
/ Moderator

Jul 1, 2006, 3:56 PM
Post #9 of 32
(18134 views)
Shortcut
|
|
Re: [abbydabby] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi, Thanks for the post! It sounds to me like this issue has to do with the point of the script that logs into Article Manager and re-publishes your articles. At this point I think you'll just want to fill out a Support Request with your FTP details here: https://www.interactivetools.com/support/email_support.cgi This should allow me to get onto your server and have a closer look at the templates for you. I look forward to hearing from you! Cheers, Mike Briggs - Product Specialist support@interactivetools.com
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.
|
|
|  |
 |

bonnie72
User
Jul 16, 2006, 3:22 AM
Post #10 of 32
(18002 views)
Shortcut
|
|
Re: [MikeB] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
I'm not sure I understand the use of running this script manually. Let's say I write an article, set it to 'hidden' and move the publishing date to tomorrow. Then, I will have to run the URL manually tomorrow? So, what's the difference really between running the URL manually and change the option 'hidden' to 'visible' manually? Thanks, Marco
|
|
|  |
 |

ross
Staff
/ Moderator

Jul 16, 2006, 11:17 AM
Post #11 of 32
(17980 views)
Shortcut
|
|
Re: [bonnie72] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi Marco. Thanks for posting! This addon is going to come in really handy for people working with multiple articles that need to be posted dated to publish tomorrow, or the next day, etc. What it will do is take all the hidden articles and switch them to visible if the date is correct. Lets say you had 50 articles that needed to go out next Monday. You could spend all this week writing them up but leaving them as hidden. Then when next Monday rolls around you just have to hit that one link manually and all 50 of those articles are set to visible instead of you having to go through each one switching them. Does that make sense? Basically, if you just have a couple articles to switch to visible, this addon might be more than you really need. Let me know if you would like anymore details . ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
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.
|
|
|  |
 |

bonnie72
User
Jul 16, 2006, 2:08 PM
Post #12 of 32
(17976 views)
Shortcut
|
|
Re: [ross] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
That makes sense Ross. :) I'm still interested in the script, because it can work with a cron job (running it each 15 minutes or so). But do you know which command I need to use in the cron job to activate Autopublish? Is it something like: GET http://...(domain).../autopublish.cgi?id=(USERNAME)&pw=(PASSWORD) I hope you can advice. Thanks! Marco
(This post was edited by bonnie72 on Jul 17, 2006, 12:39 PM)
|
|
|  |
 |

ross
Staff
/ Moderator

Jul 18, 2006, 9:23 AM
Post #13 of 32
(17870 views)
Shortcut
|
|
Re: [bonnie72] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi Marco. Glad to hear that you are interested in giving this a go . I am not an expert on cron jobs but I susspect you’ll just need the URL you would use to manually run the script yourself: http://yoursite.com/cgi-bin/artman/exec/autopublish.cgi?id=USERNAME&pw=PASSWORD But you probably won’t need to have it run every 15 minutes. Once per day should be enough because it will take care of all the post dated articles in one go. Keep me up to date with how you are making out . ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
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.
|
|
|  |
 |

bonnie72
User
Jul 19, 2006, 4:29 AM
Post #14 of 32
(17803 views)
Shortcut
|
|
Re: [ross] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
I tried the URL but it doesn't work, nor does the full path to the script. Does someone use cron job for this script? If so, what's the secret to run it? Marco
|
|
|  |
 |

MikeB
Staff
/ Moderator

Jul 20, 2006, 1:34 PM
Post #15 of 32
(17694 views)
Shortcut
|
|
Re: [bonnie72] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi Marco, Thanks for the post! The way that you'll set up the cronjob on your server really depends on your hosting company and you may want to get in touch with them to check the URL you should use when you're setting up a cronjob. On some servers you'll need to use the "cURL" command so the cronjob will recognize the attributes you're passing to the cronjob. I'd still recommend getting in touch with your webhost but in the meantime you may want to try using something like this: /usr/bin/curl "http://www.yoursite.com/cgi-bin/exec/autopublish.cgi?id=myuserid&pw=yourpassword" I hope this helps and if you get any details from your hosting company I'd be happy to go over those to see if I can give you a hand with getting this up and running. I look forward to hearing from you Marco! Cheers, Mike Briggs - Product Specialist support@interactivetools.com
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.
|
|
|  |
 |

bonnie72
User
Jul 24, 2006, 3:36 PM
Post #16 of 32
(17614 views)
Shortcut
|
|
Re: [MikeB] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
I don't get it working. The funny part is that I asked my host, and they say I should contact the script writers... Marco
|
|
|  |
 |

Donna
Staff
/ Moderator

Jul 25, 2006, 1:08 PM
Post #17 of 32
(17605 views)
Shortcut
|
|
Re: [bonnie72] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi Marco, Thanks for your post. Can you give us more details about what exactly you asked your host? Cron jobs are definitely something that your host should be able to give you a hand with, as they're independent of the actual script itself. If you'd rather, you can send us an email at support@interactivetools.com and we can see what else we can do for you that way. :) 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.
|
|
|  |
 |

etfreedman
User
Aug 1, 2006, 8:14 AM
Post #18 of 32
(17452 views)
Shortcut
|
|
Re: [MikeB] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
This sounds great, Mike. Is it possible to make it change an article's category automatically after a set time also? Thanks Terry Articles about information & communication technology http://www.terry-freedman.org.uk
|
|
|  |
 |

ross
Staff
/ Moderator

Aug 1, 2006, 1:44 PM
Post #19 of 32
(17446 views)
Shortcut
|
|
Re: [etfreedman] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi Terry. Thanks for posting! The original script Mike did was specific to changing articles hidden status but it should be able to modified to work with categories. Have said that though, we aren’t really setup to be doing script modifications like that at this time. The autopublish script, however, is completely open source so feel free to open it up (in any text editor) and play around with it. I can send you the programming API if you like. It’s an outline of all the different things you can do with addon scripts. Mike actually used the sample to create this script in the first place. Let me know what you think . ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
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.
|
|
|  |
 |

etfreedman
User
Aug 3, 2006, 4:54 PM
Post #20 of 32
(17402 views)
Shortcut
|
|
Re: [ross] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Thanks, Ross sorry for delay in responding. Yes, I'd like that very much Thanks Terry Articles about information & communication technology http://www.terry-freedman.org.uk
|
|
|  |
 |

Donna
Staff
/ Moderator

Aug 4, 2006, 1:17 PM
Post #21 of 32
(17377 views)
Shortcut
|
|
Re: [etfreedman] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hey Terry, Thanks for your post. :) Drop me an email at support@interactivetools.com and I can send that right out to you. :) 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.
|
|
|  |
 |

trandel
User
Aug 27, 2006, 2:39 AM
Post #22 of 32
(16493 views)
Shortcut
|
|
Re: [MikeB] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi Mike Have tried to run this on my site and get an error msg: 500 Can't connect to www.ptmgxtra.co.za:80 (Bad hostname 'www.ptmgxtra.co.za') Could not connect to server I used http://www.ptmgxtra.co.za/cgi-bin/artman/exec/autopublish.cgi?id=*****&pw=***** which is definitely a valid hostname - every other AM function works. If I try without the UN / PW I get the normal error msg but then I enter (my normal admin ones) them and get the above? I am running on a Windows Server - is this the problem? I cannot chmod 755 the script as instructed - is there a Windows server equivalent? As we will have multiple articles per publication, I really do need this ability - the APDE add-on seems to mean that I have to switch to .php instead of .shmtl which I am loathe to do. Any ideas? Regards Tony Randell
|
|
|  |
 |

trandel
User
Aug 28, 2006, 12:51 AM
Post #23 of 32
(16465 views)
Shortcut
|
|
Re: [trandel] Add-on: autopublish.cgi 1.0 - MORE INFO
[In reply to]
|
Can't Post
|
|
Hi Mike I have some more info on this: Despite the error message the script does display that it has reset the articles to visible (verified when viewed in the article editor) and published them - BUT, they don't show up in the index page unless you page the index page (more) forward and then page (previous) back. (This could be browser cache problem but repeated browser page refresh does not bring them up.) Having got the newly visible article to show up in the index page when you click on it there is a 404 page not found - this is cleared by using the publish all feature in server options. I have also tried running the script from the admin program but get the same errors? Looks like the publish process is not working because of the 500 server error. Regards Tony Randell
|
|
|  |
 |

etfreedman
User
Aug 30, 2006, 9:08 AM
Post #24 of 32
(16293 views)
Shortcut
|
|
Re: [MikeB] Add-on: autopublish.cgi 1.0
[In reply to]
|
Can't Post
|
|
Hi The error message I get is: "Unable to log in, please check Username and Password and ensure this is an administrator account". I am definitely using the correct user details, and it is an admin account. Any suggestions? Thanks Terry Articles about information & communication technology http://www.terry-freedman.org.uk
|
|
|  |
 |

MikeB
Staff
/ Moderator

Aug 30, 2006, 9:24 AM
Post #25 of 32
(16291 views)
Shortcut
|
|
Re: [trandel] Add-on: autopublish.cgi 1.0 - MORE INFO
[In reply to]
|
Can't Post
|
|
Hi Tony, Thanks for the posts and the details about this! It definitely sounds like the issue you're running into has to do with when autopublish.cgi does a re-publish of all of your articles. The error you're running into sounds like it could be related to the server not being able to accept requests from itself. If this is the case you'd actually want to get in touch with your hosting company to see if there is any way they could customize the firewall so a script like this would be able to make a request to the server. If you'd like me to get onto the server to have a look at this and run a test script that will outline what is happening then you can just pass along your FTP details here: https://www.interactivetools.com/support/email_support.cgi I look forward to hearing from you Tony! Cheers, Mike Briggs - Product Specialist support@interactivetools.com
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.
|
|
|  |
 | |  |
|