Allow your members to ?pay with a tweet?. Namely you take something that you would otherwise offer for free and make it available to your members only after they tweet about your website. It is a great way to promote your products and get noticed, and it doesn?t cost anything to your visitors.
We're going to implement this to the Download System
Demo: Alert box for announcements
[admin]Photo and Credit: Tutorialzine | Web Development Tutorials & Resources
1. Download the ZIP Making a Simple Tweet to Download System | Tutorialzine
2. Create a folder called "tweet-download" in your current theme.
3. Extract all files from the 'assets' folder and load them to the new folder you created.
Let's get rid of some items we dont need...
1. In the tweet-download/css/styles.css remove everything except:
2. In the tweet-download/img folder, remove all images except the "buttons.png".
3. In the tweet-download/js folder, remove the script.js
Now let's open the /Themes/your_theme/index.template.php
<link rel="stylesheet" href="', $settings['theme_url'], '/tweet-download/css/styles.css" />
Now let's do one more thing, edit the downloads page...
// Show the main download
echo '<a href="' . $scripturl . '?action=downloads;sa=downfile&id=', $context['downloads_file']['ID_FILE'], '">', ($context['downloads_file']['fileurl'] == '' ? $context['downloads_file']['orginalfilename'] : $txt['downloads_app_download']), '</a>';
// Show the main download
<p><a href="#" id="tweetLink">Tweet this</a> to activate the download button.</p><br />';
// Using our tweetAction plugin. For a complete list with supported
// parameters, refer to http://dev.twitter.com/pages/intents#tweet-intent
text: "Download Professional SMF Themes. Free and Premium.",
// When the user closes the pop-up window:
.attr("href", "' . $scripturl . '?action=downloads;sa=downfile&id=', $context['downloads_file']['ID_FILE'], '");
Make sure you replace your own text and Twitter id.
That's it. Have fun.
But wait! This doesn?t work!
And you are entirely correct. As you can see from the code (and confirm from the demo), we assume that closing the popup window equals a published tweet. It does not.
As this is a cross domain interaction, there is no way to subscribe for when a tweet is actually published. The only way to do this would be to use Twitter?s more complex https://dev.twitter.com/docs/anywhere/welcome, but even then people could just hotlink to your file.
Does it even matter? The real purpose of this technique is to give people an incentive to tweet about your product/service, something that a lot of folks would love to do just for the feeling of receiving your ?members-only? download.