Cookie-enabled 'Pay With A Tweet' Plugin For jQuery - payWithTweet

Cookie-enabled 'Pay With A Tweet' Plugin For jQuery - payWithTweet
File Size: 4.76 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A cookie-enabled jQuery pay with a tweet plugin which allows to lock the html content until the users tweet about your webpage. Great for revealing the download links or discount coupons after the user publishes your content on his twitter account.

See also:

How to use it:

1. Create a link to open a Twitter tweet window.

<a href="#" id="tweetLink">Pay With A Tweet</a>

2. Create a download button with no download link.

<a href="#" class="downloadButton">Download</a>

3. Link to jQuery library and the jQuery payWithTweet plugin.

<script src="//code.jquery.com/jquery-1.12.2.min.js"></script>
<script src="jquery.payWithTweet.js"></script>

4. Call the function to the tweet link and add the download link to the download button after the user closes the tweet window.

$('#tweetLink').tweetAction({

  // text to share
  text: 'Check out this awesome page',

  // url to share
  url: 'https://www.jqueryscript.net/',

  // your twitter account
  via: 'jqueryscript',

  // enable cookies
  cookies: true
  
}, function () {
  $('a.downloadButton')

    // add a custom css class
    .addClass('btn-danger')

    // add the download link to the download button
    .attr('href','1.zip');

}); 

This awesome jQuery plugin is developed by maxt3r. For more Advanced Usages, please check the demo page or visit the official website.