This commit is contained in:
Ismo Vuorinen
2021-11-12 17:46:17 +02:00
parent f5a0a5ab4d
commit 59e6717fc2
10 changed files with 286 additions and 52 deletions

View File

@@ -1,8 +1,10 @@
# xkcd-Mailer #
# 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, if it has not been sent before.
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 ##
## configuration
The script needs a simple configuration. Modify ``config.example.php`` to fit your needs and save as ``config.php``
@@ -14,7 +16,7 @@ The script needs a simple configuration. Modify ``config.example.php`` to fit yo
*/
// Your timezone, PHP5 required.
// See full list: http://www.php.net/manual/en/timezones.php
// See full list: https://www.php.net/manual/en/timezones.php
date_default_timezone_set("Europe/Helsinki");
// Your destination
@@ -25,31 +27,33 @@ $from = "xkcd mailer <xkcdmailer@example.com>";
$lastfile = "last.txt";
```
## crontab example ##
## crontab example
Run every hour.
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.
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 ##
## caveats
Make sure to set $lastfile to a path that you have write access to.
## changes ##
## changes
- 2014-03-30 @wojas added check to see if a post already sent
## contributing ##
## contributing
- Fork the code
- Do your changes
- Send pull request
- Bask in glory of open source love
## forks <3 ##
## forks <3
* [raamdev/pennyarcade-Mailer](https://github.com/raamdev/pennyarcade-Mailer) - [Penny Arcade](http://penny-arcade.com/comic) emailer by Raam Dev
* [raamdev/pennyarcade-Mailer][pa-git] - [Penny Arcade][pa-url] emailer by Raam Dev
[pa-git]: https://github.com/raamdev/pennyarcade-Mailer
[pa-url]: http://penny-arcade.com/comic