Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Improved the Twitter service #202

Closed
wants to merge 1 commit into from

2 participants

@koraktor

Just two simple improvements:

  • Show the branch name of the commit(s) in the tweet
  • Use a dash instead of a minus. This just looks better.

Example:

[steam-condenser-ruby@update-api] git.io/Drgvag Sebastian Staudt – 1 commits

@koraktor koraktor Improved the Twitter service
 * Show the branch name
 * Use a dash instead of a minus
4ab937f
@technoweenie

Is the branch necessary? Won't it take up precious tweet characters?

@koraktor

For me, it is. Maybe it's only adequate for the digest mode?

But I'm open to suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 10, 2011
  1. @koraktor

    Improved the Twitter service

    koraktor authored
     * Show the branch name
     * Use a dash instead of a minus
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 services/twitter.rb
View
4 services/twitter.rb
@@ -10,13 +10,13 @@ def receive_push
commit = payload['commits'][-1]
author = commit['author'] || {}
tiny_url = shorten_url("#{payload['repository']['url']}/commits/#{ref_name}")
- status = "[#{repository}] #{tiny_url} #{author['name']} - #{payload['commits'].length} commits"
+ status = "[#{repository}@#{ref_name}] #{tiny_url} #{author['name']} #{payload['commits'].length} commits"
status.length >= 140 ? statuses << status[0..136] + '...' : statuses << status
else
payload['commits'].each do |commit|
author = commit['author'] || {}
tiny_url = shorten_url(commit['url'])
- status = "[#{repository}] #{tiny_url} #{author['name']} - #{commit['message']}"
+ status = "[#{repository}@#{ref_name}] #{tiny_url} #{author['name']} #{commit['message']}"
status.length >= 140 ? statuses << status[0..136] + '...' : statuses << status
end
end
Something went wrong with that request. Please try again.