nehm 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2310de5a36aa924a6313a683e9ab745e45294615
4
+ data.tar.gz: f4e9875a9c6ff92c758ef4d90ed38882dbdda365
5
+ SHA512:
6
+ metadata.gz: 336ce7cac4a0d9fdeb3f9371e16af2344dc41202cd9296822c158f237f9a8a7073bcf5e29028694d817c42430d6e79c96a1917bc34a11ce1a9f88f0b407f9aa8
7
+ data.tar.gz: 5fe2ea9bc1643413ac3bec03458b2927db379d5850c336362e8ddeed35d56fc58b3739d5aa52bbec392c9ddf59e77b196dcce0ae5f5dbf4bb3bf3efcb9768a81
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .DS_Store
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.1
4
+ before_install: gem install bundler -v 1.10.5
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in nehm.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2015 Albert Nigmatzianov
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # nehm
2
+
3
+ *nehm* is a console tool, which downloads, sets IDv3 tags and adds to your iTunes library your SoundCloud posts or likes (also by url) in convenient way
4
+
5
+ ## Installation
6
+
7
+ **1. First, you should install `taglib` library**
8
+
9
+ **Mac OS X:**
10
+
11
+ `brew install taglib`
12
+
13
+ or
14
+
15
+ `sudo port install taglib`
16
+
17
+ **Linux** (depends on your package manager):
18
+
19
+ Debian/Ubuntu: ` sudo apt-get install libtag1-dev`
20
+
21
+ Fedora/RHEL: ` sudo yum install taglib-devel`
22
+
23
+ **2. Then you can install `nehm` gem:**
24
+
25
+ `gem install nehm`
26
+
27
+ **That's all!**
28
+
29
+ ## First usage
30
+
31
+ If you just installed nehm, you should set it up
32
+
33
+ Write `nehm init` for it
34
+
35
+ nehm should answer like this:
36
+ ```
37
+ Hello!
38
+ Before using the nehm, you should set it up:
39
+ Enter a FULL path to desirable download directory (press enter to set it to ...
40
+ ```
41
+
42
+ **Now you can use nehm!**
43
+ Go to usage for further instructions
44
+
45
+ ## Usage
46
+
47
+ **!!nehm doesn't add tracks to iTunes library, if you use Linux!!**
48
+
49
+ * To get (download to download directory, set tags and add to Itunes library) your last like
50
+
51
+ `nehm get like`
52
+
53
+ * To get your last post (last track or repost from your profile)
54
+
55
+ `nehm get post`
56
+
57
+ * To get multiple last posts or likes
58
+
59
+ `nehm get 3 posts` or `nehm get 3 likes`
60
+
61
+ * To just download and set tags any track, you can input
62
+
63
+ `nehm dl post` or `nehm dl like` or `nehm dl 3 likes` and etc.
64
+
65
+ * And of course you can get or download track from url
66
+
67
+ `nehm get https://soundcloud.com/nasa/delta-iv-launch`
68
+
69
+ or
70
+
71
+ `nehm dl https://soundcloud.com/nasa/delta-iv-launch`
72
+
73
+ * Also, you can configure nehm (change download directory, iTunes directory, permalink)
74
+
75
+ `nehm configure`
76
+
77
+ * For help, just input
78
+
79
+ `nehm help`
80
+
81
+ ##FAQ
82
+
83
+ **Q: What is permalink?**
84
+
85
+ A: Permalink is the last word in your profile url. Example: for profile url 'soundcloud.com/qwerty' permalink is 'qwerty'
86
+
87
+ ## Contributing
88
+
89
+ Bug reports and pull requests are welcome on GitHub at https://github.com/bogem/nehm.
90
+
91
+ ## Links
92
+
93
+ My SoundCloud profile: https://soundcloud.com/bogem
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ require_relative 'lib/nehm/version.rb'
2
+ task default: %w(build install delete)
3
+
4
+ file = 'nehm-' + Nehm::VERSION + '.gem'
5
+
6
+ task :build do
7
+ system('gem build nehm.gemspec')
8
+ end
9
+
10
+ task :install do
11
+ system('gem install ./' + file)
12
+ end
13
+
14
+ task :delete do
15
+ File.delete('./' + file)
16
+ end
17
+
18
+ task :push => :build do
19
+ system('gem push ' + file)
20
+ end
data/bin/nehm ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require 'nehm'
3
+ App.do(ARGV)
@@ -0,0 +1,24 @@
1
+ class Artwork
2
+ def initialize(track)
3
+ @track = track
4
+ end
5
+
6
+ def file_path
7
+ id = @track.id
8
+ file_name = "#{id}.jpg"
9
+ File.join('/tmp', file_name)
10
+ end
11
+
12
+ def suicide
13
+ File.delete(file_path)
14
+ end
15
+
16
+ def dl_url
17
+ hash = @track.hash
18
+ if hash['artwork_url'].nil?
19
+ hash['user']['avatar_url'].sub('large', 't500x500')
20
+ else
21
+ hash['artwork_url'].sub('large', 't500x500')
22
+ end
23
+ end
24
+ end