share_learning 0.2.0 → 0.2.1
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 +4 -4
- data/README.md +4 -4
- data/bin/udacity +5 -5
- data/bin/youtube +1 -1
- data/lib/share_learning/share_learning_version.rb +1 -1
- data/lib/share_learning/udacity_api.rb +1 -2
- data/lib/share_learning/udacity_course.rb +2 -4
- data/lib/share_learning/youtube_api.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87508a27360aeaf7cd129dbc54397230fb486601
|
4
|
+
data.tar.gz: 992c8efa2e5da5b1130a4a98ce4d0eeb66a428a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd01e4183acef511164073e003eb6173b2be1d623767402213e209401ffc3a96f2ec6c1fe90ce3d4bbbfeaf1e190a13a147ba8c0081b0d2073444b6ed93e5cfb
|
7
|
+
data.tar.gz: 8a422b7f00defad9439462f149319ac84d9306a6341dd12f8740cf5339825b0d51820a80721ca4e916ddb1f4916de4530b3d9d05d500d2b98ae8deef507181bb
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
# share_learning
|
3
|
-
[](https://badge.fury.io/rb/share_learning)
|
4
|
+
[](https://travis-ci.org/BlueStarAshes/share_learning)
|
5
5
|
|
6
6
|
|
7
7
|
## Introduction
|
@@ -100,7 +100,7 @@ BASIC USAGE: `udacity [command][feature]`
|
|
100
100
|
|
101
101
|
#### In your project
|
102
102
|
|
103
|
-
First, `require '
|
103
|
+
First, `require 'share_learning'` in your code.
|
104
104
|
See the following example code for more usage details:
|
105
105
|
|
106
106
|
```ruby
|
@@ -130,7 +130,7 @@ get_course_by_id = courses.acquire_course_by_title(course_title)
|
|
130
130
|
* `[keyword]` - helps you search and get information of playlists on YouTube.
|
131
131
|
|
132
132
|
#### In your project
|
133
|
-
* `require '
|
133
|
+
* `require 'share_learning'`
|
134
134
|
See the following example code for more usage details:
|
135
135
|
```ruby
|
136
136
|
# Access playlists data
|
data/bin/udacity
CHANGED
@@ -66,13 +66,13 @@ def action(command, feature=nil)
|
|
66
66
|
when 'search'
|
67
67
|
check_feature_available('search', feature)
|
68
68
|
course = Udacity::UdacityCourse.find().acquire_courses_by_keywords(feature)
|
69
|
-
if course.
|
69
|
+
if course.empty?
|
70
|
+
puts 'no courses found'
|
71
|
+
else
|
70
72
|
course.each do |item|
|
71
73
|
show(item)
|
72
74
|
puts "\n" + "------"
|
73
|
-
end
|
74
|
-
else
|
75
|
-
puts 'no courses found'
|
75
|
+
end
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
@@ -80,4 +80,4 @@ end
|
|
80
80
|
command = ARGV[0]
|
81
81
|
feature = ARGV[1]
|
82
82
|
check_command_available(command)
|
83
|
-
action(command, feature)
|
83
|
+
action(command, feature)
|
data/bin/youtube
CHANGED
@@ -67,9 +67,7 @@ module Udacity
|
|
67
67
|
|
68
68
|
course_array = append_course(course_array, course)
|
69
69
|
end
|
70
|
-
|
71
|
-
return 'no courses found' if course_array.empty?
|
72
|
-
course_array # return course_array if it is not empty
|
70
|
+
course_array
|
73
71
|
end
|
74
72
|
|
75
73
|
# # get courses by skill levels ('', 'beginner', 'intermediate', 'advanced')
|
@@ -98,4 +96,4 @@ module Udacity
|
|
98
96
|
new(UdacityAPI, course_data, total_course_num)
|
99
97
|
end
|
100
98
|
end
|
101
|
-
end
|
99
|
+
end
|
@@ -5,7 +5,8 @@ module YouTube
|
|
5
5
|
# using YouTube API to get playlists
|
6
6
|
class YouTubeAPI
|
7
7
|
max_results = 8 # number of videos that should be returned
|
8
|
-
YouTube_URL = 'https://www.googleapis.com/youtube/v3/search?part=snippet
|
8
|
+
YouTube_URL = 'https://www.googleapis.com/youtube/v3/search?part=snippet' + \
|
9
|
+
'&type=playlist&order=relevance&maxResults=' + max_results.to_s
|
9
10
|
|
10
11
|
def self.config=(credentials)
|
11
12
|
@config ? @config.update(credentials) : @config = credentials
|
@@ -19,7 +20,8 @@ module YouTube
|
|
19
20
|
# Retrieve the search results
|
20
21
|
def self.get_playlist(keyword)
|
21
22
|
search_response =
|
22
|
-
HTTP.get(YouTube_URL + '&q=' + keyword.split().join('+') +
|
23
|
+
HTTP.get(YouTube_URL + '&q=' + keyword.split().join('+') + \
|
24
|
+
'&key=' + config[:api_key])
|
23
25
|
JSON.parse(search_response)
|
24
26
|
end
|
25
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: share_learning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ashleycheng, blureze, meegoStar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|