public
Fork of pjhyett/github-services
Description: Official GitHub Services Integration
Homepage: http://github.com/blog/53-github-services-ipo
Clone URL: git://github.com/github/github-services.git
fix twitter bug and remove some old code
pjhyett (author)
Tue Apr 29 16:20:10 -0700 2008
commit  31b2698a37a68921c20b2c0045a533afd626e330
tree    f9a19f7e54edcf49609ad1c1e1e665b6ad255965
parent  d289dd134716ea297306701e7926b0d25e81567f
...
1
2
3
4
5
6
7
8
9
10
11
 
12
13
14
15
16
 
 
 
 
 
 
 
 
17
18
...
1
 
 
2
 
 
 
 
 
 
 
3
4
5
6
 
 
7
8
9
10
11
12
13
14
15
16
0
@@ -1,18 +1,16 @@
0
 service :twitter do |data, payload|
0
- repository = payload['repository']['name']
0
- branch = payload['ref'].split('/').last
0
   twitter = Twitter::Base.new(data['username'], data['password'])
0
- begin
0
- Timeout::timeout(2) do
0
- url = Net::HTTP.get "tinyurl.com", "/api-create.php?url=#{commit['url']}"
0
- end
0
- rescue
0
- end
0
- url ||= commit['url']
0
+ repository = payload['repository']['name']
0
 
0
   payload['commits'].each do |commit|
0
     commit = commit.last
0
- text = "[#{repository}] #{url} #{commit['author']['name']} - #{commit['message']}"
0
- twitter.post text
0
+ begin
0
+ Timeout::timeout(2) do
0
+ url = Net::HTTP.get "tinyurl.com", "/api-create.php?url=#{commit['url']}"
0
+ end
0
+ rescue
0
+ end
0
+ url ||= commit['url']
0
+ twitter.post "[#{repository}] #{url} #{commit['author']['name']} - #{commit['message']}"
0
   end
0
 end

Comments

    No one has commented yet.