mirror of
https://github.com/ivuorinen/xkcd-Mailer.git
synced 2026-02-06 01:48:36 +00:00
Only send posts that have not been sent before; ID of last post is saved in $lastfile; HTML fixes
This commit is contained in:
16
README.md
16
README.md
@@ -1,6 +1,6 @@
|
||||
# xkcd-Mailer #
|
||||
|
||||
Takes the first/latest item from the [xkcd](http://xkcd.com/) atom-feed and mails the image and punchline to a specified email address.
|
||||
Takes the first/latest item from the [xkcd](http://xkcd.com/) atom-feed and mails the image and punchline to a specified email address, if it has not been sent before.
|
||||
|
||||
## configuration ##
|
||||
|
||||
@@ -20,20 +20,28 @@ date_default_timezone_set("Europe/Helsinki");
|
||||
// Your destination
|
||||
$mail = "your@email.com";
|
||||
$from = "xkcd mailer <xkcdmailer@example.com>";
|
||||
|
||||
// File to write ID of last post to
|
||||
$lastfile = "last.txt";
|
||||
```
|
||||
|
||||
|
||||
## crontab example ##
|
||||
|
||||
15 minutes over 7am on monday, wednesday and friday.
|
||||
Run every hour.
|
||||
|
||||
15 7 * * 1,3,5 /usr/bin/php /full/path/to/xkcd-mailer.php
|
||||
0 * * * * /usr/bin/php /full/path/to/xkcd-mailer.php
|
||||
|
||||
This version will check if the last post was already emailed and will only send the post
|
||||
if it has not been emailed yet.
|
||||
|
||||
## caveats ##
|
||||
|
||||
- Script doesn't check has the feed been updated, possibly causing old strip delivery
|
||||
Make sure to set $lastfile to a path that you have write access to.
|
||||
|
||||
## changes ##
|
||||
|
||||
- 2014-03-30 @wojas added check to see if a post already sent
|
||||
|
||||
## contributing ##
|
||||
|
||||
|
||||
Reference in New Issue
Block a user