-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
227 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
|
||
An extension to Radiant that will automatically tweet the publication of new pages in selected parts of your site, and which provides a set of radius tags that allow you to feature twitter feeds of different kinds on your site. | ||
|
||
## Installation | ||
|
||
sudo gem install twitter | ||
sudo gem install radiant-twitter-extension | ||
|
||
## Configuration | ||
|
||
You can present twitter searches and feeds without authenticating, but if you want to post automatically to twitter you need to provide login information. The extension adds a 'twitter' block to the main radiant configuration interface: enter your screen name and password. Future versions may integrate with Twitter as an application but for now all we need is the ability to tweet. | ||
|
||
## Tweet on publication | ||
|
||
To post a tweet every time you publish a blog entry, check the 'Notify Twitter of newly published child pages?' box on the parent blog page. The tweet will contain the title of the page and its url. | ||
|
||
## Display a twitter feed | ||
|
||
If radiant is configured to tweet for you, all you need is this radius tag: | ||
|
||
<r:twitter:tweets [max="10"] /> | ||
|
||
If it's not configured, or you want to display another user: | ||
|
||
<r:twitter:tweets user="screen_name" /> | ||
|
||
To display a hashtag, or any other search: | ||
|
||
<r:twitter:tweets search="#radiant" /> | ||
|
||
To display tweets from someone's list: | ||
|
||
<r:twitter:tweets user="screen_name" list="list_name" /> | ||
|
||
The default presentation of tweets is exactly as [specified by Twitter](https://dev.twitter.com/terms/display-guidelines) and if you include their widget script and the provided css it should all just work. If you want to present tweets differently, a range of more detailed radius tags is available. This is a slightly more compact format: | ||
|
||
<r:twitter:tweets user="screen_name" /> | ||
<li class="tweet"> | ||
<r:tweet:avatar class="avatar" /> | ||
<r:tweet:user:screen_name /> | ||
<span class="block"> | ||
<r:tweet:text /> | ||
</span> | ||
<span class="hidden"> | ||
<r:tweet:reply_link /> | ||
<r:tweet:retweet_link /> | ||
</span> | ||
</li> | ||
</r:twitter:tweets> | ||
## Scripts and styles | ||
|
||
The quick way to format tweets nicely is to include the supplied sass in your site stylesheet. If you're using radiant's built-in stylesheet manager and working in Sass, you can keep everything in one file (and selectively override it) by including this line near the top: | ||
|
||
@import 'twitter.sass' | ||
|
||
You can also link to `/stylesheets/twitter.css` in the usual way. | ||
|
||
The links created by radius tags here are all compatible with twitter's widgeting. To enable basic intent-based popups, just include this line in the head or at the foot of your layout: | ||
|
||
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> | ||
|
||
## Todo | ||
|
||
* Smoother twitter integration | ||
* Page field to enter tweet text before publication | ||
* URL-shortener | ||
|
||
## Copyright and license | ||
|
||
Originally created by Sean Cribbs and now the work of many hands: | ||
|
||
* Jim Gay | ||
* Edmund Haselwanter | ||
* Anna Billstrom | ||
* William Ross | ||
|
||
Currently maintained by Will at spanner.org. Issues and comments on github, please: | ||
|
||
https://github.com/radiant/radiant-twitter-extension/issues | ||
|
||
Released under the same terms as Rails and/or Radiant. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
en: | ||
activerecord: | ||
attributes: | ||
page: | ||
notify_twitter_of_children: "Notify Twitter of newly published child pages?" | ||
config: | ||
twitter: | ||
username: "Username (for tweets)" | ||
password: "Password (for tweets)" | ||
token: "Application token (for feeds)" | ||
secret: "Application secret (for feeds)" | ||
token: "Application token" | ||
secret: "Application secret" | ||
date: | ||
formats: | ||
twitter: "%m %B" | ||
twitter_extension: | ||
favorite: "Favorite" | ||
reply: "Reply" | ||
retweet: "Retweet" | ||
twitter: "Twitter" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- encoding: utf-8 -*- | ||
$:.push File.expand_path("../lib", __FILE__) | ||
require "radiant-twitter-extension" | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "radiant-twitter-extension" | ||
s.version = RadiantTwitterExtension::VERSION | ||
s.platform = Gem::Platform::RUBY | ||
s.authors = RadiantTwitterExtension::AUTHORS | ||
s.email = RadiantTwitterExtension::EMAIL | ||
s.homepage = RadiantTwitterExtension::URL | ||
s.summary = RadiantTwitterExtension::SUMMARY | ||
s.description = RadiantTwitterExtension::DESCRIPTION | ||
|
||
s.add_dependency 'twitter', "~> 1.6.0" | ||
|
||
ignores = if File.exist?('.gitignore') | ||
File.read('.gitignore').split("\n").inject([]) {|a,p| a + Dir[p] } | ||
else | ||
[] | ||
end | ||
s.files = Dir['**/*'] - ignores | ||
s.test_files = Dir['test/**/*','spec/**/*','features/**/*'] - ignores | ||
# s.executables = Dir['bin/*'] - ignores | ||
s.require_paths = ["lib"] | ||
|
||
s.post_install_message = %{ | ||
Add this to your radiant project with: | ||
config.gem 'radiant-twitter-extension', :version => '~>#{RadiantTwitterExtension::VERSION}' | ||
} | ||
end |
Oops, something went wrong.