public
Description: Read an RSS feed (even HTTPS with authentication) and rebroadcast it to a Twitter account.
Clone URL: git://github.com/trak3r/rss2twitter.git
Search Repo:
Created a string truncation test for a sanity check.
trak3r (author)
Wed Apr 30 07:07:04 -0700 2008
commit  149c7f9389a7c6d10d589d81409532f7f1212a10
tree    ff8d54d85e0b077ff068d6c2da8915d18ec43a78
parent  48eef21d8beec7ff101790ea83422f6a612b688b
...
18
19
20
21
 
22
23
24
...
30
31
32
33
 
34
35
36
...
18
19
20
 
21
22
23
24
...
30
31
32
 
33
34
35
36
0
@@ -18,7 +18,7 @@
0
   protected
0
   
0
   def tweet_limit
0
- 139 # leave one off for fudging
0
+ 138 # leave one off for fudging
0
   end
0
 
0
   def short_url
0
@@ -30,7 +30,7 @@
0
     # extraneous verbiage to save every last precious character
0
     tidbits = self.title.scan( /^Changeset \[(.*?)\]\: (.*)/ ).flatten
0
     if 2 == tidbits.length
0
- return sprintf( "%s %s", *tidbits )
0
+ return tidbits[1] # sprintf( "%s %s", *tidbits )
0
     else # not a Trac changeset or we failed to parse it
0
       return self.title
0
     end
...
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
0
@@ -1 +1,12 @@
0
+#!/bin/ruby
0
+
0
+max = 140 # message limit for twitter
0
+
0
+for x in 1..max do
0
+ printf "%d", ( x % 10 )
0
+end
0
+printf "\n"
0
+
0
+msg = "You are only coming through in waves. Your lips move but I can't hear what you're saying. I have become comfortably numb. A distant ship's smoke on the horizon."
0
+printf "%s", msg[0..max]

Comments

    No one has commented yet.