DaveChild Reply #1, 3 years, 1 month ago
This snippet returns a link to twitter for the user to tweet the a URL (current page by default) with its title. URL is TinyURLed automatically (and tinyurls are cached indefinitely in assets/cache/tweetthis.txt).
Usage
Simply paste code (in attached file) into a new snippet called "TweetThis". Call it like so:
Parameters (all parameters are optional).
&name - can be your Twitter ID if you prefix with "@".
&text - will default to "Tweet This!".
&id - will default to the current document id.
Updates
Update 0.2 - more efficient storage of tinyurls (using id rather than url as key).
Update 0.3 - added id as optional parameter.
Update 0.4 - added check to ensure id is numeric. If not, snippet writes error to event log and uses default document id instead.
Usage
Simply paste code (in attached file) into a new snippet called "TweetThis". Call it like so:
Parameters (all parameters are optional).
&name - can be your Twitter ID if you prefix with "@".
&text - will default to "Tweet This!".
&id - will default to the current document id.
Updates
Update 0.2 - more efficient storage of tinyurls (using id rather than url as key).
Update 0.3 - added id as optional parameter.
Update 0.4 - added check to ensure id is numeric. If not, snippet writes error to event log and uses default document id instead.





