Coder Social home page Coder Social logo

bluebird-statamic's Introduction

BlueBird by Nick Snyder

A Twitter plugin for Statamic CMS

BlueBird is a Twitter API 1.1 plugin for the Statamic CMS. With BlueBird, you can pull down a predefined number of tweets from any user with publically available tweets. BlueBird automatically coverts hashtags, URLs, and mentions into their appropriate links.

To get started, simply upload the folders to the appropriate directories. If you haven't registered for a Twitter API, you may do so here. After you obtain your Access Token, Access Token Secret, Consumer Key, and Consumer Secret, add them to "_config/add-ons/bluebird.yaml". That's it!

Support, Feature Requests, and Donations

For support, the best way is to get at me on Twitter (fancy that): @_FasterHorses.

If you have any feature requests, please submit them via BlueBird's issues page on GitHub

Did you find this plugin useful? Please consider donating.

Example Code Block

{{ bluebird screen_name="_FasterHorses" count="1" }}
		{{ tweets }}
			<div>
				<p>{{ text }}</p>
				<p>
					<small>
						<a href="{{ tweet_url }}">{{ created_at format="F jS, Y" }}</a>
					</small>
				</p>
			</div>
		{{ /tweets }}
		{{ user }}
			<div>
				<a href="https://twitter.com/{{ screen_name }}">
					<img src="{{ profile_image_url }}" alt="{{ screen_name }} on Twitter">
					Follow Me on Twitter!
				</a>
				<ul>
					<li>{{ followers_count }} Followers</li>
					<li>Listed {{ listed_count }} times</li>
				</ul>
			</div>
		{{ /user }}
{{ /bluebird }}

Documentation

Parameters

  • screen_name (required) - Screen name of the user who's tweets you'd like to display; no @ symbol, please.
  • count - Number of tweets you'd like to display Default: 5
  • include_rts - Option to include retweets as part of your count Default: true
  • include_entities - Option to automatically convert entities into live links Default: true

Tag Pairs & Variables

BlueBird contains two tag pairs: {{ tweets }} and {{ user }}.

The {{ tweets }} tag pair allows you access to everything in the Twitter API. Using the Statamic shorthand of {{ level1:level2 }}, you can access nested arrays.

  • {{ created_at }} - Echos the creation date of the tweet; You may use PHP's date functions to format (e.g. {{ created_at format="F jS, Y" }} )
  • {{ id }} - ID of the tweet in number format
  • {{ id_str }} - ID of the tweet in string format
  • {{ text }} - Actual tweet
  • {{ tweet_url }} - a pre-built URL for each tweet
  • {{ source }} - Client used for the tweet
  • {{ retweet_count }} - Amount of times the tweet has been retweeted
  • {{ favorited }} - Amount of times the tweet has been favorited
  • {{ retweeted }} - Returns true if tweet was a retweet, rather than original
  • {{ user:id }} - ID if the user in number format
  • {{ user:id_str }} - ID if the user in string format
  • {{ user:name }} - Full name of the user
  • {{ user:screen_name }} - User's Twitter handle
  • {{ user:location }} - User's location (per the profile, rather than tweet)
  • {{ user:url }} - User's URL
  • {{ user:description }} - User's description
  • {{ user:protected }} - Returns true if the user has a protected account
  • {{ user:followers_count }} - Number of followers
  • {{ user:friends_count }} - Number of friends
  • {{ user:listed_count }} - Amount of times the user has been lsited
  • {{ user:created_at }} - User's join date
  • {{ user:favourites_count }} - Amount of favorites the user has
  • {{ user:time_zone }} - User's Time Zone
  • {{ user:verified }} - Returns true if the user has a verified account
  • {{ user:status_count }} - Number of tweets
  • {{ user:profile_image_url }} - URL of the user's profile image

The {{ user }} tag pair allows you to return just user data without displaying tweets.

  • {{ id }} - ID if the user in number format
  • {{ id_str }} - ID if the user in string format
  • {{ name }} - Full name of the user
  • {{ screen_name }} - User's Twitter handle
  • {{ location }} - User's location (per the profile, rather than tweet)
  • {{ url }} - User's URL
  • {{ description }} - User's description
  • {{ protected }} - Returns true if the user has a protected account
  • {{ followers_count }} - Number of followers
  • {{ friends_count }} - Number of friends
  • {{ listed_count }} - Amount of times the user has been lsited
  • {{ created_at }} - User's join date
  • {{ favourites_count }} - Amount of favorites the user has
  • {{ time_zone }} - User's Time Zone
  • {{ verified }} - Returns true if the user has a verified account
  • {{ status_count }} - Number of tweets
  • {{ profile_image_url }} - URL of the user's profile image

MIT License

Copyright (c) 2013 Nick Snyder

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

bluebird-statamic's People

Contributors

jlbruno avatar

Watchers

 avatar  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.