transmission-rss 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +5 -1
- data/lib/transmission-rss.rb +1 -1
- data/lib/transmission-rss/aggregator.rb +8 -8
- data/lib/transmission-rss/client.rb +3 -5
- data/lib/transmission-rss/log.rb +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
transmission-rss is basically a workaround for transmission's lack of the
|
4
4
|
ability to monitor RSS feeds and automatically add enclosed torrent links.
|
5
5
|
|
6
|
+
It works with transmission-daemon and transmission-gtk (if the web frontend is
|
7
|
+
enabled in the settings dialog). Sites like seriesly.com and ezrss.it are suited
|
8
|
+
well as feed sources.
|
9
|
+
|
6
10
|
As it's done with poems, I devote this very artful and romantic piece of code to
|
7
11
|
the single most delightful human being: Ann.
|
8
12
|
|
@@ -51,6 +55,6 @@ and coult be omitted). The default +log_target+ is STDERR.
|
|
51
55
|
|
52
56
|
== TODO
|
53
57
|
|
54
|
-
* Timeout and error handling
|
58
|
+
* Timeout and error handling in +Aggregator+ and +Client+
|
55
59
|
* Drop privileges
|
56
60
|
* Option to stop seeding after full download
|
data/lib/transmission-rss.rb
CHANGED
@@ -56,17 +56,17 @@ class TransmissionRSS::Aggregator
|
|
56
56
|
end
|
57
57
|
|
58
58
|
items.each do |item|
|
59
|
-
item.
|
59
|
+
link = item.link
|
60
|
+
|
61
|
+
if( link.class != String )
|
60
62
|
link = link.href
|
63
|
+
end
|
61
64
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
+
if( not seen?( link ) )
|
66
|
+
on_new_item( link )
|
67
|
+
@log.add( 'on_new_item event ' + link )
|
65
68
|
|
66
|
-
|
67
|
-
# else
|
68
|
-
# @log.add( 'already seen ' + link )
|
69
|
-
end
|
69
|
+
add_seen( link )
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
@@ -12,12 +12,12 @@ class TransmissionRSS::Client
|
|
12
12
|
@port = port
|
13
13
|
|
14
14
|
@log = Log.instance
|
15
|
+
|
16
|
+
@sessionid = getSessionID
|
15
17
|
end
|
16
18
|
|
17
19
|
# Get transmission session id by simple GET.
|
18
20
|
def getSessionID
|
19
|
-
@log.add( 'getSessionID called' )
|
20
|
-
|
21
21
|
get = Net::HTTP::Get.new(
|
22
22
|
'/transmission/rpc'
|
23
23
|
)
|
@@ -49,13 +49,11 @@ class TransmissionRSS::Client
|
|
49
49
|
|
50
50
|
# POST json packed torrent add command.
|
51
51
|
def addTorrent( torrentFile, paused = false )
|
52
|
-
@log.add( 'addTorrent called' )
|
53
|
-
|
54
52
|
post = Net::HTTP::Post.new(
|
55
53
|
'/transmission/rpc',
|
56
54
|
initheader = {
|
57
55
|
'Content-Type' => 'application/json',
|
58
|
-
'X-Transmission-Session-Id' =>
|
56
|
+
'X-Transmission-Session-Id' => @sessionid
|
59
57
|
}
|
60
58
|
)
|
61
59
|
|
data/lib/transmission-rss/log.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transmission-rss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- henning mueller
|