rdelicious 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/rdelicious/version.rb +1 -1
- data/lib/rdelicious.rb +6 -6
- data/website/index.html +10 -6
- data/website/index.txt +8 -4
- data/website/template.rhtml +1 -1
- metadata +2 -2
data/History.txt
CHANGED
data/lib/rdelicious/version.rb
CHANGED
data/lib/rdelicious.rb
CHANGED
@@ -2,7 +2,7 @@ $:.unshift File.dirname(__FILE__)
|
|
2
2
|
require 'rubygems'
|
3
3
|
require 'net/https'
|
4
4
|
require 'rexml/document'
|
5
|
-
require '
|
5
|
+
require 'cgi'
|
6
6
|
|
7
7
|
class Rdelicious
|
8
8
|
|
@@ -25,7 +25,7 @@ class Rdelicious
|
|
25
25
|
|
26
26
|
# Return true if user already got this url in his delicious list
|
27
27
|
def url_exists?(url)
|
28
|
-
resp = request("/v1/posts/get?&url=#{CGI
|
28
|
+
resp = request("/v1/posts/get?&url=#{CGI.escape(url)}")
|
29
29
|
begin
|
30
30
|
print "resp: #{resp}"
|
31
31
|
# XML Document
|
@@ -39,15 +39,15 @@ class Rdelicious
|
|
39
39
|
|
40
40
|
# Add an url and descritpion to user delicious
|
41
41
|
def add(url, description, extended = nil, tags = nil)
|
42
|
-
request = "/v1/posts/add?&url=#{CGI
|
43
|
-
request << "&extended=#{CGI
|
44
|
-
request << "&tags=#{CGI
|
42
|
+
request = "/v1/posts/add?&url=#{CGI.escape(url)}&description=#{CGI.escape(description)}"
|
43
|
+
request << "&extended=#{CGI.escape(extended)}" unless extended.nil?
|
44
|
+
request << "&tags=#{CGI.escape(tags)}" unless tags.nil?
|
45
45
|
request(request)
|
46
46
|
end
|
47
47
|
|
48
48
|
# Delete an url and descritpion to user delicious
|
49
49
|
def delete(url)
|
50
|
-
request = "/v1/posts/delete?&url=#{CGI
|
50
|
+
request = "/v1/posts/delete?&url=#{CGI.escape(url)}"
|
51
51
|
request(request)
|
52
52
|
end
|
53
53
|
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>rdelicious</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/rdelicious"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/rdelicious" class="numbers">1.0.
|
36
|
+
<a href="http://rubyforge.org/projects/rdelicious" class="numbers">1.0.1</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘rdelicious’</h1>
|
39
39
|
|
@@ -61,13 +61,17 @@
|
|
61
61
|
|
62
62
|
<span class="ident">print</span> <span class="punct">"</span><span class="string">Correct login</span><span class="punct">"</span> <span class="keyword">if</span> <span class="attribute">@delicious</span><span class="punct">.</span><span class="ident">is_connected?</span>
|
63
63
|
|
64
|
-
<span class="attribute">@delicious</span><span class="punct">.</span><span class="ident">add</span><span class="punct">("</span><span class="string">http://rdelicious.rubyforge.net/</span><span class="punct">",</span> <span class="punct">"</span><span class="string">Rdelicious Gem</span><span class="punct">"
|
64
|
+
<span class="attribute">@delicious</span><span class="punct">.</span><span class="ident">add</span><span class="punct">("</span><span class="string">http://rdelicious.rubyforge.net/</span><span class="punct">",</span> <span class="punct">"</span><span class="string">Rdelicious Gem</span><span class="punct">")</span>
|
65
65
|
|
66
|
-
<span class="
|
66
|
+
<span class="keyword">if</span> <span class="attribute">@delicious</span><span class="punct">.</span><span class="ident">url_exists?</span><span class="punct">("</span><span class="string">http://rdelicious.rubyforge.net/</span><span class="punct">")</span>
|
67
|
+
<span class="ident">print</span> <span class="punct">"</span><span class="string">Url inserted into delicious</span><span class="punct">"</span>
|
68
|
+
<span class="keyword">end</span>
|
67
69
|
|
68
70
|
<span class="attribute">@delicious</span><span class="punct">.</span><span class="ident">delete</span><span class="punct">("</span><span class="string">http://rdelicious.rubyforge.net</span><span class="punct">")</span>
|
69
71
|
|
70
|
-
<span class="
|
72
|
+
<span class="keyword">unless</span> <span class="attribute">@delicious</span><span class="punct">.</span><span class="ident">url_exists?</span><span class="punct">("</span><span class="string">http://rdelicious.rubyforge.net/</span><span class="punct">")</span>
|
73
|
+
<span class="ident">print</span> <span class="punct">"</span><span class="string">Url deleted from delicious</span><span class="punct">"</span>
|
74
|
+
<span class="keyword">end</span>
|
71
75
|
</pre></p>
|
72
76
|
|
73
77
|
|
@@ -95,9 +99,9 @@
|
|
95
99
|
<h2>Contact</h2>
|
96
100
|
|
97
101
|
|
98
|
-
<p>Comments are welcome. Send an email to <a href="mailto:
|
102
|
+
<p>Comments are welcome. Send an email to <a href="mailto:alx.girard@gmail.com">Alexandre Girard</a> via the <a href="http://groups.google.com/group/rdelicious">forum</a></p>
|
99
103
|
<p class="coda">
|
100
|
-
<a href="
|
104
|
+
<a href="mailto:alx.girard@gmail.com">Alexandre Girard</a>, 31st October 2007<br>
|
101
105
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
102
106
|
</p>
|
103
107
|
</div>
|
data/website/index.txt
CHANGED
@@ -21,13 +21,17 @@ require 'rdelicious'
|
|
21
21
|
|
22
22
|
print "Correct login" if @delicious.is_connected?
|
23
23
|
|
24
|
-
@delicious.add("http://rdelicious.rubyforge.net/", "Rdelicious Gem"
|
24
|
+
@delicious.add("http://rdelicious.rubyforge.net/", "Rdelicious Gem")
|
25
25
|
|
26
|
-
|
26
|
+
if @delicious.url_exists?("http://rdelicious.rubyforge.net/")
|
27
|
+
print "Url inserted into delicious"
|
28
|
+
end
|
27
29
|
|
28
30
|
@delicious.delete("http://rdelicious.rubyforge.net")
|
29
31
|
|
30
|
-
|
32
|
+
unless @delicious.url_exists?("http://rdelicious.rubyforge.net/")
|
33
|
+
print "Url deleted from delicious"
|
34
|
+
end
|
31
35
|
</pre>
|
32
36
|
|
33
37
|
h2. Forum
|
@@ -46,5 +50,5 @@ This code is free to use under the terms of the "Creative Commons GNU GPL":http:
|
|
46
50
|
|
47
51
|
h2. Contact
|
48
52
|
|
49
|
-
Comments are welcome. Send an email to "
|
53
|
+
Comments are welcome. Send an email to "Alexandre Girard":mailto:alx.girard@gmail.com via the "forum":http://groups.google.com/group/rdelicious
|
50
54
|
|
data/website/template.rhtml
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
</div>
|
38
38
|
<%= body %>
|
39
39
|
<p class="coda">
|
40
|
-
<a href="
|
40
|
+
<a href="mailto:alx.girard@gmail.com">Alexandre Girard</a>, <%= modified.pretty %><br>
|
41
41
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
42
42
|
</p>
|
43
43
|
</div>
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rdelicious
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date:
|
6
|
+
version: 1.0.1
|
7
|
+
date: 2008-01-09 00:00:00 +01:00
|
8
8
|
summary: Delicious API wrapper for ruby
|
9
9
|
require_paths:
|
10
10
|
- lib
|