Giter Site home page Giter Site logo

thuongha-pizzahut / tweetable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omarish/tweetable

0.0 1.0 0.0 124 KB

Plugin to turn any html element into a twitter link that either uses the native app, or falls back to web.

HTML 23.34% JavaScript 76.66%

tweetable's Introduction

Overview

Tweetable is a plugin to turn any html element into a twitter link that either uses the native app, or falls back to web.

Tweetable provides an ideal experience for users who want to tweet headlines, quotes, and other highlighted content directly from your blog.

#Setup Include the following before your </head> tag (note that on Wordpress or other blog templates, there’s usually a place to paste custom code like this):

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
 <script src="http://omarish.com/tweetable/tweetable.js"></script>

(Note: if you get SSL errors, simply copy the entire code in this repo between your <head></head> tabs, your Wordpess/other custom code box, or ask your webdeveloper ;)

#Use

  1. Once you have Tweetable setup, find a piece of text that you want to make Tweetable.
  2. Wrap the text in <a></a> (Tweetable will work on other html elements too, but makes it look like a link which avoids confusion)
  3. Set href = "#"
  4. Set class = "tweetable". If you already have assigned other classes to this element, simply separate them with spaces: class = "class1 class2 tweetable".

#Optional Parameters

  • data-user: Set the twitter handle that should get credit for the post (you).
  • data-message: By default, Tweetable will use the text within the HTML element as the text of the tweet, but you can set alternate tweet text via this parameter.

#Example

 <a class="specialformatting tweetable" data-user="nootrobox" href="#">Here's the text I want my readers to tweet.</a>

For a live example, see The Nootrobox blog and more information on this page.

tweetable's People

Contributors

mdb1216 avatar omarish avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.