Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Improved the Twitter service #202

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions services/twitter.rb
Expand Up @@ -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
Expand Down