feedly_ruby_client 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0ec8030cc70456ced85698d04790cb4da21e3c4196811257945398498d17e6a1
4
+ data.tar.gz: 699c916e53318b55f5763dd3c9fd0ceab1866239adef2601fe6d4a5625d75f23
5
+ SHA512:
6
+ metadata.gz: a19d38d7414d050aad094d5fe0add9ce2e45d1b7336cf16e5551dc5c8bac15132c6880a89b493ff3ad4461744ab399ade36d651048803a4b1ebe0c9cf324b256
7
+ data.tar.gz: e675b43488ed52a7d06a07dd2af803a3283444b16e6c80a83ec7b1336b8dcfef2d33cf7f0edc6045d7838837b5c1d5cefbe83414d9ad8dd2eaa8d662a9b6ccd8
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1.1
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at sh07e1916@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in feedly_ruby_client.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,60 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ feedly_ruby_client (0.1.0)
5
+ faraday
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.5.0)
11
+ faraday (1.10.0)
12
+ faraday-em_http (~> 1.0)
13
+ faraday-em_synchrony (~> 1.0)
14
+ faraday-excon (~> 1.1)
15
+ faraday-httpclient (~> 1.0)
16
+ faraday-multipart (~> 1.0)
17
+ faraday-net_http (~> 1.0)
18
+ faraday-net_http_persistent (~> 1.0)
19
+ faraday-patron (~> 1.0)
20
+ faraday-rack (~> 1.0)
21
+ faraday-retry (~> 1.0)
22
+ ruby2_keywords (>= 0.0.4)
23
+ faraday-em_http (1.0.0)
24
+ faraday-em_synchrony (1.0.0)
25
+ faraday-excon (1.1.0)
26
+ faraday-httpclient (1.0.1)
27
+ faraday-multipart (1.0.3)
28
+ multipart-post (>= 1.2, < 3)
29
+ faraday-net_http (1.0.1)
30
+ faraday-net_http_persistent (1.2.0)
31
+ faraday-patron (1.0.0)
32
+ faraday-rack (1.0.0)
33
+ faraday-retry (1.0.3)
34
+ multipart-post (2.1.1)
35
+ rake (13.0.6)
36
+ rspec (3.11.0)
37
+ rspec-core (~> 3.11.0)
38
+ rspec-expectations (~> 3.11.0)
39
+ rspec-mocks (~> 3.11.0)
40
+ rspec-core (3.11.0)
41
+ rspec-support (~> 3.11.0)
42
+ rspec-expectations (3.11.0)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.11.0)
45
+ rspec-mocks (3.11.1)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.11.0)
48
+ rspec-support (3.11.0)
49
+ ruby2_keywords (0.0.5)
50
+
51
+ PLATFORMS
52
+ x86_64-darwin-21
53
+
54
+ DEPENDENCIES
55
+ feedly_ruby_client!
56
+ rake (~> 13.0)
57
+ rspec (~> 3.0)
58
+
59
+ BUNDLED WITH
60
+ 2.4.6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 a5-stable
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # FeedlyApi
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/feedly_ruby_client`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'feedly_ruby_client'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install feedly_ruby_client
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/feedly_ruby_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/feedly_ruby_client/blob/main/CODE_OF_CONDUCT.md).
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the FeedlyApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/feedly_ruby_client/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/feedly_api/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "feedly_ruby_client"
7
+ spec.version = FeedlyApi::VERSION
8
+ spec.authors = ["a5-stable"]
9
+ spec.email = ["sh07e1916@gmail.com"]
10
+
11
+ spec.summary = "feedly ruby api client"
12
+ spec.description = "feedly ruby api client"
13
+ spec.homepage = "https://github.com/a5-stable"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
+
17
+ spec.metadata["source_code_uri"] = "https://github.com/a5-stable/feedly-ruby-client"
18
+ spec.metadata["changelog_uri"] = "https://github.com/a5-stable/feedly-ruby-client"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
+ `git ls-files -z`.split("\x0").reject do |f|
24
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
25
+ end
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_dependency "faraday"
32
+ end
@@ -0,0 +1,15 @@
1
+ module FeedlyApi
2
+ class Client
3
+ module Boards
4
+
5
+ def boards
6
+ get("boards")
7
+ end
8
+
9
+ def update_board(tag_id, params = {})
10
+ params[:id] = tag_id
11
+ post("boards", params)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,10 @@
1
+ module FeedlyApi
2
+ class Client
3
+ module Categories
4
+
5
+ def categories
6
+ get("categories")
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,39 @@
1
+ module FeedlyApi
2
+ class Client
3
+ module Collections
4
+
5
+ def collections
6
+ get("collections")
7
+ end
8
+
9
+ def collection(collection_id)
10
+ get("collections/#{CGI.escape(collection_id)}")
11
+ end
12
+
13
+ def create_collection(params = {})
14
+ post("collections", params)
15
+ end
16
+
17
+ def update_collection(collection_id, params = {})
18
+ params[:id] = collection_id
19
+ post("collections", params)
20
+ end
21
+
22
+ def add_feed(collection_id, params = {})
23
+ put("collections/#{CGI.escape(collection_id)}/feeds", params)
24
+ end
25
+
26
+ def add_feeds(collection_id, params = {})
27
+ post("collections/#{CGI.escape(collection_id)}/feeds.mput")
28
+ end
29
+
30
+ def remove_feed(collection_id, feed_id)
31
+ delete("collections/#{CGI.escape(collection_id)}/feeds/#{CGI.escape(feed_id)}")
32
+ end
33
+
34
+ def remove_feeds(collection_id, params = {})
35
+ delete("collections/#{CGI.escape(collection_id)}/feeds.mdelete", params)
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,14 @@
1
+ module FeedlyApi
2
+ class Client
3
+ module Feeds
4
+
5
+ def feeds(params = {})
6
+ get("feeds/.mget", params)
7
+ end
8
+
9
+ def feed(feed_id)
10
+ get("feeds/#{CGI.escape(feed_id)}")
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module FeedlyApi
2
+ class Client
3
+ module Markers
4
+
5
+ def markers
6
+ get("markers/counts")
7
+ end
8
+
9
+ def update_markers(params = {})
10
+ post("markers", params)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ module FeedlyApi
2
+ class Client
3
+ module Search
4
+ def search_feeds(params = {})
5
+ get("search/feeds", params)
6
+ end
7
+
8
+ def search_entities(params = {})
9
+ get("search/entities", params)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ module FeedlyApi
2
+ class Client
3
+ module Tags
4
+
5
+ def tags
6
+ res = get("tags")
7
+ JSON.parse(res.body)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,29 @@
1
+ require 'feedly_api/client/boards'
2
+ require 'feedly_api/client/categories'
3
+ require 'feedly_api/client/collections'
4
+ require 'feedly_api/client/feeds'
5
+ require 'feedly_api/client/markers'
6
+ require 'feedly_api/client/search'
7
+ require 'feedly_api/client/tags'
8
+ require 'feedly_api/request'
9
+ require 'json'
10
+
11
+ module FeedlyApi
12
+ class Client
13
+ include FeedlyApi::Client::Boards
14
+ include FeedlyApi::Client::Categories
15
+ include FeedlyApi::Client::Collections
16
+ include FeedlyApi::Client::Feeds
17
+ include FeedlyApi::Client::Markers
18
+ include FeedlyApi::Client::Search
19
+ include FeedlyApi::Client::Tags
20
+ include FeedlyApi::Request
21
+
22
+ attr_accessor :access_token
23
+
24
+ def initialize(params)
25
+ raise 'access token required' if params.fetch(:access_token).nil?
26
+ @access_token = params.fetch(:access_token)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,52 @@
1
+ module FeedlyApi
2
+ module Request
3
+ ENDPOINT_BASE = "http://cloud.feedly.com".freeze
4
+ API_VERSION_PATH = '/v3/'.freeze
5
+
6
+ def get(path, params = {})
7
+ path = API_VERSION_PATH + path
8
+ res = conn.get(path, params)
9
+
10
+ respond(res)
11
+ end
12
+
13
+ def post(path, params = {})
14
+ path = API_VERSION_PATH + path
15
+ res = conn.post(path, params)
16
+
17
+ respond(res)
18
+ end
19
+
20
+ def put(path, params = {})
21
+ path = API_VERSION_PATH + path
22
+ res = conn.post(path, params)
23
+
24
+ respond(res)
25
+ end
26
+
27
+ def delete(path, params = {})
28
+ path = API_VERSION_PATH + path
29
+ res = conn.delete(path, params)
30
+
31
+ respond(res)
32
+ end
33
+
34
+ private
35
+
36
+ def conn
37
+ @conn ||= Faraday.new(ENDPOINT_BASE, headers: base_headers)
38
+ end
39
+
40
+ def base_headers
41
+ {
42
+ Accept: "application/json",
43
+ :"Content-Type" => "application/json",
44
+ Authorization: "Bearer #{access_token}"
45
+ }
46
+ end
47
+
48
+ def respond(res)
49
+ JSON.parse(res.body)
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FeedlyApi
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ require_relative 'feedly_api/client'
3
+ require_relative "feedly_api/version"
4
+
5
+ module FeedlyApi
6
+ class Error < StandardError; end
7
+ # Your code goes here...
8
+ end
@@ -0,0 +1,4 @@
1
+ module FeedlyApi
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: feedly_ruby_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - a5-stable
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-02-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: feedly ruby api client
28
+ email:
29
+ - sh07e1916@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rspec"
35
+ - ".ruby-version"
36
+ - CODE_OF_CONDUCT.md
37
+ - Gemfile
38
+ - Gemfile.lock
39
+ - LICENSE.txt
40
+ - README.md
41
+ - Rakefile
42
+ - feedly_ruby_client.gemspec
43
+ - lib/feedly_api/client.rb
44
+ - lib/feedly_api/client/boards.rb
45
+ - lib/feedly_api/client/categories.rb
46
+ - lib/feedly_api/client/collections.rb
47
+ - lib/feedly_api/client/feeds.rb
48
+ - lib/feedly_api/client/markers.rb
49
+ - lib/feedly_api/client/search.rb
50
+ - lib/feedly_api/client/tags.rb
51
+ - lib/feedly_api/request.rb
52
+ - lib/feedly_api/version.rb
53
+ - lib/feedly_ruby_client.rb
54
+ - sig/feedly_ruby_client.rbs
55
+ homepage: https://github.com/a5-stable
56
+ licenses:
57
+ - MIT
58
+ metadata:
59
+ source_code_uri: https://github.com/a5-stable/feedly-ruby-client
60
+ changelog_uri: https://github.com/a5-stable/feedly-ruby-client
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 2.6.0
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubygems_version: 3.3.7
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: feedly ruby api client
80
+ test_files: []