De.linque.nt 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/README +148 -0
  2. data/bin/delinquent +90 -0
  3. data/doc/classes/Delinquent.html +250 -0
  4. data/doc/classes/Delinquent.src/M000001.html +18 -0
  5. data/doc/classes/Delinquent.src/M000002.html +18 -0
  6. data/doc/classes/Delinquent.src/M000003.html +25 -0
  7. data/doc/classes/Delinquent.src/M000004.html +29 -0
  8. data/doc/classes/Delinquent.src/M000005.html +29 -0
  9. data/doc/classes/Delinquent.src/M000006.html +18 -0
  10. data/doc/classes/Delinquent.src/M000007.html +18 -0
  11. data/doc/classes/Delinquent.src/M000008.html +19 -0
  12. data/doc/classes/Delinquent.src/M000009.html +18 -0
  13. data/doc/classes/Delinquent.src/M000010.html +19 -0
  14. data/doc/classes/Delinquent.src/M000011.html +18 -0
  15. data/doc/classes/Delinquent.src/M000012.html +18 -0
  16. data/doc/classes/Delinquent.src/M000013.html +18 -0
  17. data/doc/classes/Delinquent.src/M000014.html +25 -0
  18. data/doc/classes/Delinquent.src/M000015.html +29 -0
  19. data/doc/classes/Delinquent.src/M000016.html +29 -0
  20. data/doc/classes/Delinquent.src/M000017.html +18 -0
  21. data/doc/classes/Delinquent.src/M000018.html +18 -0
  22. data/doc/created.rid +1 -0
  23. data/doc/files/README.html +298 -0
  24. data/doc/files/examples/deform_rb.html +101 -0
  25. data/doc/files/lib/de_linque_nt_rb.html +110 -0
  26. data/doc/files/pkg/De_linque_nt-0_0_1/examples/deform_rb.html +101 -0
  27. data/doc/files/pkg/De_linque_nt-0_0_1/lib/de_linque_nt_rb.html +110 -0
  28. data/doc/fr_class_index.html +27 -0
  29. data/doc/fr_file_index.html +28 -0
  30. data/doc/fr_method_index.html +33 -0
  31. data/doc/index.html +24 -0
  32. data/doc/rdoc-style.css +208 -0
  33. data/examples/deform.rb +13 -0
  34. data/js/bloglines.delinquent.user.js +119 -0
  35. data/js/delinquent.user.js +117 -0
  36. data/lib/de.linque.nt.rb +117 -0
  37. metadata +95 -0
data/README ADDED
@@ -0,0 +1,148 @@
1
+ = De.linque.nt: An irresponsible metaweb posting tool.
2
+ === The Future is Here and it's Right Behind You!(tm)
3
+
4
+ Here's the premise: Del.icio.us, the social bookmarking site, lets you create posts
5
+ that assign a set of tags to a URL. The post also provides a description field as well
6
+ as an area for extended information.
7
+
8
+ Usually, Del.icio.us posts refer to some other Web resource, but the act of creating a
9
+ Del.icio.us post also creates a new Web resource: the Del.icio.us URL for the new post.
10
+
11
+ Since this Del.icio.us post is a Web resource it can itself be the target of a
12
+ Del.icio.us post. In fact, one can create posts for Del.icio.us resources that do not
13
+ exist *until* the post is created, i.e., the post URL you bookmark is the one that will refer
14
+ to the bookmark you are creating. And that is what De.linque.nt does.
15
+
16
+ When you install the De.linque.nt gem, it creates a helper app to generate a posting
17
+ script named 'delinquentry'. You need to provide a Del.icio.us user name and password,
18
+ and optionally define the base tag for your De.linque.nt posts. You can then call
19
+ delinquentry, passing in the text for the post description and extended info fields.
20
+
21
+ The De.linque.nt class will create an as-yet nonexistent URL based off the main Del.icious URL,
22
+ your base tag, and a time stamp. This URL is then becomes a Del.icio.us post, which is
23
+ tagged with both this unique tag and the plain base tag.
24
+
25
+ You can read any specific De.linque.nt post by referring to its unique tag, or see all the
26
+ posts by indexing on the base tag.
27
+
28
+ Requirements:
29
+
30
+ * Rubilicious, a Ruby library for the Del.icio.us API
31
+ * A Del.icio.us account
32
+ * Too much free time
33
+
34
+
35
+ == Some Possible Usage
36
+
37
+ === Low-rent Blogging: It's like having a blog without bothering with the blog part.
38
+ Define some base tag (e.g. MyDelinquentBlog). Add Del.icio.us posts expressing your
39
+ profound, worldly insights. Be succinct: The description field and extended text field
40
+ only allow 256 characters each.
41
+
42
+ Presto! Instablog!
43
+
44
+ Since Del.icio.us offers RSS feeds based on users and tags, you can create a simple
45
+ message feed using Del.icio.us metaposts.
46
+
47
+ Tell all your hip friends to subscribe to the RSS feed for your base tag and
48
+ revel in your Web 2.0 hiptitude.
49
+
50
+
51
+ === Cheesy IM: OMG! This is /so/ 1337!
52
+ Create a Del.icio.us account and share it with your friends. Have them all install
53
+ De.linque.nt using the same Del.icio.us account and base tag. Make sure everyone
54
+ subscribes to the RSS feed for the base tag. Now you and your De.linque.nt pals can
55
+ exchange messages by posting through Del.icio.us!
56
+
57
+
58
+ === Doo Dah Lists
59
+ Be antisocial and *don't* tell anyone about your sweet De.linque.nt postings.
60
+ Just use it to post random notes from the command line. All De.linque.nt posts are
61
+ given two tags by default: the base tag (either the default 'De.linque.nt' or the
62
+ tag you've chosen when installing the posting script ), plus a GUID tag formed
63
+ by glomming a time-stamp onto the base tag. But you can add more tags to your post
64
+ by including text inside of square brackets, like this:
65
+
66
+ % deliquentry.rb This is my title. This is the body [each word in here is a tag]
67
+
68
+ (So be careful when adding text: all words inside of square brackets are assumed
69
+ to be tags.)
70
+
71
+ Using your own tags, you can create a set of categorized posts to act as your
72
+ super-bad Doo Dah list! You'll be Getting Real and Getting Things Done in no time!
73
+
74
+ Zippity Doo Dah, Zippity F***in' A!
75
+
76
+ === Get Creative. Or Something. It's a Greasemonkey World!*
77
+
78
+ De.linque.nt also includes two Greasemonkey scripts designed to work with Del.icio.us
79
+ and Bloglines.
80
+
81
+ Each looks for feeds that contain your base tag in the URL. So, for example, if
82
+ you have the base tag "SquibbleNod", your De.linque.nt posts will have URLs
83
+ similar to http://del.icio.us/username/SquibbleNod2005661232.
84
+
85
+ The Greasemonkey scripts find De.linque.nt items and pass the title and content
86
+ through "reform" methods. By default, these don't do anything, but there is simple
87
+ code in place to do some trivial rot13 decoding to demo the madness.
88
+
89
+ The De.linque.nt distro also includes simple Ruby code for rot13 encoding.
90
+
91
+ When De.linque.nt makes a post, it first calls deform_title and deform_content
92
+ before sending the text off to Del.icio.us. The class has stub methods in place
93
+ for this.
94
+
95
+ There are two ways (at least) to make these useful. One is to create a file named
96
+ 'deform.rb' and place it in the same directory as the auto-generated delinquentry.rb
97
+ script. In the file you need to redefine those two Delinquent methods, as in this
98
+ example:
99
+
100
+ class Delinquent
101
+
102
+ # rot13 encoding. Very DMCA!
103
+ def deform_title( t )
104
+ t.tr "A-Za-z", "N-ZA-Mn-za-m";
105
+ end
106
+
107
+ def deform_content( c )
108
+ c.tr "A-Za-z", "N-ZA-Mn-za-m";
109
+ end
110
+ end
111
+
112
+ You can also just add this code directly to delinquentry.rb, after the call
113
+ to "require 'delinquent'"
114
+
115
+ So, with this example, all posts will have the title (i.e., the description text)
116
+ and content (i.e., extended text) encoded. To read the posts once it is on
117
+ Delicio.us, then, you'll need to reverse the process (or work it out in your head).
118
+
119
+ That's where Greasemonkey comes in. After locating a De.linque.nt post, each
120
+ Greasemonkey script rewrites the title and content by calling reform_title
121
+ and reform_content. By default these methods do nothing, but if you look
122
+ at the code you'll see some code commented out to do the decryption.
123
+
124
+ In Real Life(tm), though, you might want to use something a bit more secure.
125
+ There is a JavaScript block TEA (Tine Encryption Algorithm) library available at
126
+ http://www.movable-type.co.uk/scripts/TEAblock.html
127
+
128
+ Of course, you'll need to encrypt the source using the same algorithm, and you'll need to
129
+ use the same password and such at both ends. And share this with you bestest friends
130
+ if you want to pass messages around. Oh, and such encryption methods tend to increase
131
+ the size of the transmitted message; make sure the results still fit into the
132
+ alloted 256 character. But after that you're golden.
133
+
134
+
135
+ Have fun!
136
+
137
+ James Britt
138
+ jamesgb AT neurogami DOT com
139
+
140
+ ==== Credits:
141
+
142
+ Thanks to Paul Duncan for Rubilicious[http://www.pablotron.org/software/rubilicious/]
143
+
144
+ Thanks to joshua and crew for Del.icio.us[http://del.icio.us/]
145
+
146
+ Special thanks to K. G�del and D. Hofstadter
147
+
148
+
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift( "../lib" )
3
+
4
+ require 'de.linque.nt'
5
+ require 'ftools'
6
+
7
+
8
+ def usage
9
+ puts <<-USAGE
10
+
11
+ NAME
12
+ delinquent - creates a new Delinquent application
13
+
14
+ SYNOPSIS
15
+ delinquent user_name password [base_tag]
16
+
17
+
18
+ DESCRIPTION
19
+ This will create a simple script and a configuration file so that you can
20
+ make Delinquent posts to Del.icio.us
21
+
22
+
23
+
24
+ EXAMPLE
25
+ delinquent gumby seekret doodle.monkey
26
+
27
+ This will generate a new De.linque.nt script and config file so that each
28
+ post will be sent to the 'gumby' Del.icio.us account. All such posts wil have the
29
+ base tag 'doodle.monkey'; each post will also have a unique tag created by combining
30
+ 'doodle.monkey' with a time stamp string.
31
+
32
+ You can then make De.linque.nt posts by calling
33
+
34
+ $ delinquentry.rb This is the description. The rest is the extended text.
35
+
36
+ USAGE
37
+ exit 1
38
+ end
39
+
40
+
41
+
42
+ def run
43
+ if ARGV[0]
44
+ opts = {}
45
+ opts[ 'user_name' ] = ARGV[0] || usage()
46
+ opts[ 'password' ] = ARGV[1] || usage()
47
+ opts[ 'base_tag' ] = ARGV[2] || 'De.linque.nt'
48
+
49
+
50
+ File.open( "#{opts[ 'base_tag' ]}.yml" , "wb"){ |f|
51
+ %w{ user_name password base_tag }.each{|opt| f.puts( "#{opt}: #{opts[ opt ]}")}
52
+ }
53
+
54
+
55
+ File.open( "delinquentry.rb", "wb") { |f|
56
+ f.puts <<-CODE
57
+ require 'de.linque.nt'
58
+ begin
59
+ require 'deform'
60
+ rescue Exception; end
61
+ Delinquent.new( :config_file => '#{opts[ 'base_tag' ]}.yml' ).post_from_cli
62
+ CODE
63
+ }
64
+
65
+ tag_re = Regexp.escape( opts[ 'base_tag' ] )
66
+
67
+
68
+ js_src = IO.read( "#{File.expand_path( File.dirname( __FILE__ ) )}/../js/delinquent.user.js" )
69
+
70
+ js_src.gsub!( 'De\.linque\.nt', tag_re )
71
+ File.open( "delinquent.user.js", "wb") { |f|
72
+ f.puts js_src
73
+ }
74
+
75
+ js_src = IO.read( "#{File.expand_path( File.dirname( __FILE__ ) )}/../js/bloglines.delinquent.user.js" )
76
+ js_src.gsub!( 'De\.linque\.nt', tag_re )
77
+ File.open( "bloglines.delinquent.user.js", "wb") { |f|
78
+ f.puts js_src
79
+ }
80
+
81
+ else
82
+ usage()
83
+ end
84
+ end
85
+
86
+ run
87
+
88
+ # This script is based on Michael Neumann's Wee creator script.
89
+ # Nice work, Mike!
90
+
@@ -0,0 +1,250 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Delinquent</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Delinquent</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/de_linque_nt_rb.html">
59
+ lib/de.linque.nt.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ Allows one to create a post on del.icio.us that is itslef the URL ofr which
84
+ the postnis tagging. Quite meta. The initializer must be gigven either
85
+ :user_name and :password, or :config_file (the name of a YAML file with
86
+ user_name and password hash values). You can also pass in :base_tag, or use
87
+ the default.
88
+ </p>
89
+
90
+ </div>
91
+
92
+
93
+ </div>
94
+
95
+ <div id="method-list">
96
+ <h3 class="section-bar">Methods</h3>
97
+
98
+ <div class="name-list">
99
+ <a href="#M000005">add</a>&nbsp;&nbsp;
100
+ <a href="#M000002">deform_content</a>&nbsp;&nbsp;
101
+ <a href="#M000001">deform_title</a>&nbsp;&nbsp;
102
+ <a href="#M000003">new</a>&nbsp;&nbsp;
103
+ <a href="#M000004">post_from_cli</a>&nbsp;&nbsp;
104
+ <a href="#M000006">recent</a>&nbsp;&nbsp;
105
+ <a href="#M000007">where_i_live</a>&nbsp;&nbsp;
106
+ </div>
107
+ </div>
108
+
109
+ </div>
110
+
111
+
112
+ <!-- if includes -->
113
+
114
+ <div id="section">
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <!-- if method_list -->
124
+ <div id="methods">
125
+ <h3 class="section-bar">Public Class methods</h3>
126
+
127
+ <div id="method-M000003" class="method-detail">
128
+ <a name="M000003"></a>
129
+
130
+ <div class="method-heading">
131
+ <a href="Delinquent.src/M000003.html" target="Code" class="method-signature"
132
+ onclick="popupCode('Delinquent.src/M000003.html');return false;">
133
+ <span class="method-name">new</span><span class="method-args">( opts = { } )</span>
134
+ </a>
135
+ </div>
136
+
137
+ <div class="method-description">
138
+ </div>
139
+ </div>
140
+
141
+ <div id="method-M000007" class="method-detail">
142
+ <a name="M000007"></a>
143
+
144
+ <div class="method-heading">
145
+ <a href="Delinquent.src/M000007.html" target="Code" class="method-signature"
146
+ onclick="popupCode('Delinquent.src/M000007.html');return false;">
147
+ <span class="method-name">where_i_live</span><span class="method-args">()</span>
148
+ </a>
149
+ </div>
150
+
151
+ <div class="method-description">
152
+ </div>
153
+ </div>
154
+
155
+ <h3 class="section-bar">Public Instance methods</h3>
156
+
157
+ <div id="method-M000005" class="method-detail">
158
+ <a name="M000005"></a>
159
+
160
+ <div class="method-heading">
161
+ <a href="Delinquent.src/M000005.html" target="Code" class="method-signature"
162
+ onclick="popupCode('Delinquent.src/M000005.html');return false;">
163
+ <span class="method-name">add</span><span class="method-args">( title, content )</span>
164
+ </a>
165
+ </div>
166
+
167
+ <div class="method-description">
168
+ <p>
169
+ Adds a new post with the given description and extended text. You can add
170
+ your own tags by enclsing thme in [ brackets ]
171
+ </p>
172
+ </div>
173
+ </div>
174
+
175
+ <div id="method-M000002" class="method-detail">
176
+ <a name="M000002"></a>
177
+
178
+ <div class="method-heading">
179
+ <a href="Delinquent.src/M000002.html" target="Code" class="method-signature"
180
+ onclick="popupCode('Delinquent.src/M000002.html');return false;">
181
+ <span class="method-name">deform_content</span><span class="method-args">( content_str )</span>
182
+ </a>
183
+ </div>
184
+
185
+ <div class="method-description">
186
+ </div>
187
+ </div>
188
+
189
+ <div id="method-M000001" class="method-detail">
190
+ <a name="M000001"></a>
191
+
192
+ <div class="method-heading">
193
+ <a href="Delinquent.src/M000001.html" target="Code" class="method-signature"
194
+ onclick="popupCode('Delinquent.src/M000001.html');return false;">
195
+ <span class="method-name">deform_title</span><span class="method-args">( title_str )</span>
196
+ </a>
197
+ </div>
198
+
199
+ <div class="method-description">
200
+ </div>
201
+ </div>
202
+
203
+ <div id="method-M000004" class="method-detail">
204
+ <a name="M000004"></a>
205
+
206
+ <div class="method-heading">
207
+ <a href="Delinquent.src/M000004.html" target="Code" class="method-signature"
208
+ onclick="popupCode('Delinquent.src/M000004.html');return false;">
209
+ <span class="method-name">post_from_cli</span><span class="method-args">()</span>
210
+ </a>
211
+ </div>
212
+
213
+ <div class="method-description">
214
+ <p>
215
+ If this file is called directly it invokes <tt><a
216
+ href="Delinquent.html#M000004">post_from_cli</a></tt> It expects there to
217
+ be some value in ARGV. All the text up to the first &#8217;.&#8217;
218
+ character is the description; the remaining text is the extended text. The
219
+ content is then posted to Del.icio.us
220
+ </p>
221
+ </div>
222
+ </div>
223
+
224
+ <div id="method-M000006" class="method-detail">
225
+ <a name="M000006"></a>
226
+
227
+ <div class="method-heading">
228
+ <a href="Delinquent.src/M000006.html" target="Code" class="method-signature"
229
+ onclick="popupCode('Delinquent.src/M000006.html');return false;">
230
+ <span class="method-name">recent</span><span class="method-args">( count = 10 )</span>
231
+ </a>
232
+ </div>
233
+
234
+ <div class="method-description">
235
+ </div>
236
+ </div>
237
+
238
+
239
+ </div>
240
+
241
+
242
+ </div>
243
+
244
+
245
+ <div id="validator-badges">
246
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
247
+ </div>
248
+
249
+ </body>
250
+ </html>