PublishToTwitter by Ferdi

Offers an option to publish a page to Twitter when the date for publishing is past/scheduled. Works only for Twitter API v1

PublishToTwitter

Processwire 3.x module to Tweet pages


In short this module offers an option to publish a page to Twitter when the date for publishing is past/scheduled.

After filling out the Twitter credentials, select your preferable template(s) which should have the option added to Tweet the pages using it. Additional select the field to use as publicationdate to check if the Tweet should be send now or later, a field which contains the page title.

Optional you can fill out the name of the website which will be added after the title (in case space is available).

Optional you can select the field where the page image(s) are placed (up to four can be tweeted, but mind the upload time).

v1.0.2 Removed use of Bit.ly

Includes instructions to set a cron (template or LazyCron), returns log in assets folder.

Uses (included) TwitterOAuth PHP library (https://github.com/abraham/twitteroauth) written by [abraham](https://github.com/abraham).

To use the module combined with a cron, the following code can be used in a template.

// when using LazyCron

if ($this->cronInterval) { $this->addHook("LazyCron::{$this->cronInterval}", null, 'RunCronPublishToTwitter'); } else { if (date('G') > 7 && date('G') < 23) { $this->addHook('LazyCron::every5Minutes', null, 'RunCronPublishToTwitter'); } else { $this->addHook('LazyCron::every6Hours', null, 'RunCronPublishToTwitter'); } }

// OR - for use in manual cron

$ptt = wire("modules")->get("PublishToTwitter"); $ptt->RunCronPublishToTwitter();

Check out the Processwire modules section for more details.

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #544
    In the 150th issue of ProcessWire Weekly we'll check out brand-new third party module called Inputfield Dependency Helper, share some recent highlights from the support forum, and more. Read on!
    Weekly.pw / 12 October 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer