jopilot-api 0.1.0

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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +85 -0
  4. data/jopilot_api.rb +53 -0
  5. metadata +79 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3e55b9a214834fd1fb304561e08fd7590b79b9c2765c808aa022c8d1de948e54
4
+ data.tar.gz: 103d4703aa1fb45a742d1fbf097ad139d62b0cae06887b175998851f99e4425c
5
+ SHA512:
6
+ metadata.gz: 6e4429d344b0e8334c59aa7e8cfe1e3725b7e3e0596fe3f1666c07119ef36b700e3e7eec821df0afea3b6c7b543c5f602a607a7ecbfa6bf2994507d3810f9f97
7
+ data.tar.gz: 4999626e7d7663867d4697aa3d1577958fb242fe52e4ae3ab9ba9f830f6f6ac64742eb9f7da2719208c5853c6738526f0827d031d642f2fd128b3dc5768b62d2
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 JoPilot
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,85 @@
1
+ # JoPilotAPI-Ruby
2
+
3
+ ## Overview
4
+ JoPilotAPI-Ruby is a Ruby library designed to interact with the JoPilot API, allowing developers to integrate AI-powered job search functionality into their applications.
5
+
6
+ ## API Documentation
7
+ For detailed API documentation, visit:
8
+ [JoPilot API Documentation](https://api.jopilot.net/swagger/index.html)
9
+
10
+ ## What is JoPilot?
11
+ JoPilot is a cutting-edge AI-driven job search assistant that helps users find the best job opportunities tailored to their needs. With JoPilot, you can access intelligent job search capabilities through our API.
12
+
13
+ To learn more, visit:
14
+ [JoPilot Official Website](https://jopilot.net/)
15
+
16
+ ## ChatGPT Plugin
17
+ JoPilot is also available as a ChatGPT plugin to enhance your job search experience:
18
+ [JoPilot ChatGPT Plugin](https://chatgpt.com/g/g-OMF6BEtGB-jopilot)
19
+
20
+ ## Installation
21
+ Add this line to your application's Gemfile:
22
+
23
+ ```ruby
24
+ gem 'jopilot-api'
25
+ ```
26
+
27
+ And then execute:
28
+
29
+ ```bash
30
+ $ bundle install
31
+ ```
32
+
33
+ Or install it yourself as:
34
+
35
+ ```bash
36
+ $ gem install jopilot-api
37
+ ```
38
+
39
+ ## Usage
40
+ Here's a basic example of how to use the library to perform a job search:
41
+
42
+ ```ruby
43
+ require 'jopilot_api'
44
+
45
+ # Create a job search request
46
+ request = JoPilotAPI::JobSearchRequest.new(
47
+ title: 'driver',
48
+ size: 2
49
+ )
50
+
51
+ # Perform the job search
52
+ begin
53
+ result = JoPilotAPI::JobSearchService.search_jobs(request)
54
+
55
+ # Display job results
56
+ result[:jobs].each do |job|
57
+ puts "Job: #{job[:name]} at #{job[:companyName]}"
58
+ puts "Location: #{job[:location][:city]}, #{job[:location][:state]}, #{job[:location][:country]}"
59
+ puts "Source: #{job[:feed]}"
60
+ puts "Posted: #{job[:created]}"
61
+ puts '-' * 50
62
+ end
63
+ rescue StandardError => e
64
+ puts "Failed to fetch jobs: #{e.message}"
65
+ end
66
+ ```
67
+
68
+ ## Features
69
+ - **Easy API Integration**: Call JoPilot's API with simple and intuitive methods
70
+ - **Advanced Job Search**: Search for jobs based on title, location, company name, and more
71
+ - **Real-time Updates**: Get up-to-date job listings with API requests
72
+
73
+ ## Contributing
74
+ 1. Fork it
75
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
76
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
77
+ 4. Push to the branch (`git push origin my-new-feature`)
78
+ 5. Create a new Pull Request
79
+
80
+ ## License
81
+ This project is licensed under the MIT License.
82
+
83
+ ---
84
+
85
+ Leverage the power of JoPilot and bring AI-driven job search to your Ruby applications today!
data/jopilot_api.rb ADDED
@@ -0,0 +1,53 @@
1
+ require 'net/http'
2
+ require 'json'
3
+
4
+ module JoPilotAPI
5
+ API_BASE_URL = 'https://api.jopilot.net'
6
+
7
+ class JobSearchRequest
8
+ attr_accessor :title, :company_name, :city, :state, :country, :is_remote, :size
9
+
10
+ def initialize(title:, size:, company_name: nil, city: nil, state: nil, country: nil, is_remote: nil)
11
+ @title = title
12
+ @company_name = company_name
13
+ @city = city
14
+ @state = state
15
+ @country = country
16
+ @is_remote = is_remote
17
+ @size = size
18
+ end
19
+
20
+ def to_h
21
+ {
22
+ title: @title,
23
+ companyName: @company_name,
24
+ city: @city,
25
+ state: @state,
26
+ country: @country,
27
+ isRemote: @is_remote,
28
+ size: @size
29
+ }.compact
30
+ end
31
+ end
32
+
33
+ class JobSearchService
34
+ def self.search_jobs(request)
35
+ uri = URI("#{API_BASE_URL}/api/v1/search")
36
+ http = Net::HTTP.new(uri.host, uri.port)
37
+ http.use_ssl = true
38
+
39
+ req = Net::HTTP::Post.new(uri, { 'Content-Type' => 'application/json' })
40
+ req.body = request.to_h.to_json
41
+
42
+ begin
43
+ response = http.request(req)
44
+ raise "Error: #{response.message}" unless response.is_a?(Net::HTTPSuccess)
45
+
46
+ JSON.parse(response.body, symbolize_names: true)
47
+ rescue StandardError => e
48
+ puts "Error searching jobs: #{e.message}"
49
+ raise 'There was an error connecting to the job search service.'
50
+ end
51
+ end
52
+ end
53
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jopilot-api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - JoPilot
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-03-10 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: json
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: net-http
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ description: JoPilot-API is a Ruby library designed to interact with the JoPilot API,
41
+ allowing developers to integrate AI-powered job search functionality into their
42
+ applications.
43
+ email:
44
+ - support@jopilot.net
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - LICENSE.txt
50
+ - README.md
51
+ - jopilot_api.rb
52
+ homepage: https://jopilot.net
53
+ licenses:
54
+ - MIT
55
+ metadata:
56
+ homepage_uri: https://jopilot.net
57
+ source_code_uri: https://github.com/jopilot-net/JoPilotAPI-ruby
58
+ api_uri: https://api.jopilot.net/swagger/index.html
59
+ github_repo: https://api.jopilot.net/swagger/index.html
60
+ allowed_push_host: https://rubygems.org
61
+ rdoc_options: []
62
+ require_paths:
63
+ - "."
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubygems_version: 3.6.5
76
+ specification_version: 4
77
+ summary: A Ruby library to interact with the JoPilot API, allowing job search integration
78
+ into applications.
79
+ test_files: []