How this works

What you need

To make this package work, you need to sign up for a developer account at apps.twitter.com.

The verification process can take some time and you need to provide some information on how you are going to use their API. What this package does, is publish to your Twitter account, so you can define the use of the API very clearly.

After you obtained your developer account, you need to add an application. After this is successfully done, you can get your access keys from that application and insert them into the packages' API page.

 

What you need to do

After the installation of the package, there will be a new page attribute available, which goes by the handle 'push_to_twitter' and the name 'Push this page to Twitter'. You need to add this attribute to a pagetype in your dashboard, for example the Blog Entry Type or an Event Page Type or whatever pagetype you want to use to display "newsworthy" content on your Twitter Feed.

As a next step, you need to add your API access data to the packages config page which you will find at http://yourdomain.com/index.php/dashboard/pages

 

So what this package does is:

Whenever a new page is published, this package checks if this page contains the 'push_to_twitter' attribute. If the page does not - nothing happens.

If the page does - the values of the pagetitle and the pagepath are being extracted and added together with the message you defined in the config page and push that to your twitter feed. 

So if your site has the domain http://yourdomain.com, your message says "These are the news:" and your newly added page has the title "News to the Blog" and is added below the /blog page, your Tweet will be: 
"These are the news: News to the Blog http://yourdomain.com/index.php/blog/news-to-the-blog

Twitter does not allow linebreaks or style elements to the tweets, the spaces between the parts are the only separator.


Usecases:

This package will fire on the first creation of a page and will not publish tweets afterwards when you for example edit edit a already published page.

This package will fire already when a page is added to a approval workflow. So the link to that page is available on twitter but the published page will only be accessible after approval