fetchserp 0.1.3 → 0.1.4
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 +44 -1
- data/lib/fetchserp/client.rb +10 -0
- data/lib/fetchserp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91466f965fcbd70fc4997aae636b8aa4873adcc3729dd8dad0b5fa65572c1276
|
4
|
+
data.tar.gz: da63d872dbbb50aaf8c82b43eef6ec36c2c39eaace88ce2744b20be316ae5051
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a9dc0945b450e9a090b883a98d608c6c7c3c95d44c6a62eef1fe1bedef0b11f9f112b4afbf6d613e52ceb8d61afb832fdd7ccd1b81d5455d6f6abc63e9c1947
|
7
|
+
data.tar.gz: 668d9e2193e5a32d859b07731d9eccaa52de28e53fefe10065c648c974a0dd0063ddabd448362a9ee3494944922f2291966c39e4e1da423d736127c4b91ff915
|
data/README.md
CHANGED
@@ -59,6 +59,8 @@ The client will raise `FetchSERP::Error` on any HTTP error (network, 4xx, 5xx) s
|
|
59
59
|
* `/api/v1/backlinks`
|
60
60
|
* `/api/v1/domain_emails`
|
61
61
|
* `/api/v1/domain_infos`
|
62
|
+
* `/api/v1/generate_social_content`
|
63
|
+
* `/api/v1/generate_wordpress_content`
|
62
64
|
* `/api/v1/keywords_search_volume`
|
63
65
|
* `/api/v1/keywords_suggestions`
|
64
66
|
* `/api/v1/long_tail_keywords_generator`
|
@@ -88,6 +90,8 @@ Below is the full list of convenience helpers exposed by `FetchSERP::Client`. Al
|
|
88
90
|
| `backlinks(domain:, **opts)` | `GET /api/v1/backlinks` | `domain` |
|
89
91
|
| `domain_emails(domain:, **opts)` | `GET /api/v1/domain_emails` | `domain` |
|
90
92
|
| `domain_infos(domain:)` | `GET /api/v1/domain_infos` | `domain` |
|
93
|
+
| `generate_social_content(user_prompt:, system_prompt:, **opts)` | `GET /api/v1/generate_social_content` | `user_prompt`, `system_prompt` |
|
94
|
+
| `generate_wordpress_content(user_prompt:, system_prompt:, **opts)` | `GET /api/v1/generate_wordpress_content` | `user_prompt`, `system_prompt` |
|
91
95
|
| `keywords_search_volume(keywords:, **opts)` | `GET /api/v1/keywords_search_volume` | `keywords` (Array) |
|
92
96
|
| `keywords_suggestions(url: nil, keywords: nil, **opts)` | `GET /api/v1/keywords_suggestions` | one of `url` or `keywords` |
|
93
97
|
| `long_tail_keywords_generator(keyword:, **opts)` | `GET /api/v1/long_tail_keywords_generator` | `keyword` |
|
@@ -136,6 +140,39 @@ resp = client.playwright_mcp(prompt: "Navigate to google.com and search for 'rub
|
|
136
140
|
puts resp.data["response"]
|
137
141
|
```
|
138
142
|
|
143
|
+
### Example — Generate WordPress Content with AI
|
144
|
+
|
145
|
+
```ruby
|
146
|
+
client = FetchSERP.new(api_key: ENV["FETCHSERP_API_KEY"])
|
147
|
+
|
148
|
+
# Generate SEO-optimized WordPress content
|
149
|
+
response = client.generate_wordpress_content(
|
150
|
+
user_prompt: "Write about the benefits of Ruby on Rails for web development",
|
151
|
+
system_prompt: "You are an expert web developer writing SEO content",
|
152
|
+
ai_model: "gpt-4.1-nano" # optional, defaults to gpt-4.1-nano
|
153
|
+
)
|
154
|
+
|
155
|
+
puts response.data["response"]["title"] # Access the generated title
|
156
|
+
puts response.data["response"]["content"] # Access the generated content
|
157
|
+
puts response.data["usd_cost"] # Cost of the AI request in USD
|
158
|
+
```
|
159
|
+
|
160
|
+
### Example — Generate Social Media Content with AI
|
161
|
+
|
162
|
+
```ruby
|
163
|
+
client = FetchSERP.new(api_key: ENV["FETCHSERP_API_KEY"])
|
164
|
+
|
165
|
+
# Generate engaging social media content
|
166
|
+
response = client.generate_social_content(
|
167
|
+
user_prompt: "Write a Twitter thread about Ruby's best features",
|
168
|
+
system_prompt: "You are a Ruby developer sharing insights on social media",
|
169
|
+
ai_model: "gpt-4.1-nano" # optional, defaults to gpt-4.1-nano
|
170
|
+
)
|
171
|
+
|
172
|
+
puts response.data["response"]["content"] # Access the generated social content
|
173
|
+
puts response.data["usd_cost"] # Cost of the AI request in USD
|
174
|
+
```
|
175
|
+
|
139
176
|
### Handling errors
|
140
177
|
|
141
178
|
Any 4xx/5xx response raises `FetchSERP::Error` which includes `status` and raw `body` so you can debug:
|
@@ -154,4 +191,10 @@ Bug reports and pull requests are welcome!
|
|
154
191
|
|
155
192
|
## License
|
156
193
|
|
157
|
-
GPL-3.0
|
194
|
+
GPL-3.0
|
195
|
+
|
196
|
+
Publish :
|
197
|
+
|
198
|
+
- update version
|
199
|
+
- gem build fetchserp.gemspec
|
200
|
+
- gem push fetchserp-0.1.3.gem
|
data/lib/fetchserp/client.rb
CHANGED
@@ -35,6 +35,16 @@ module FetchSERP
|
|
35
35
|
get("/api/v1/domain_infos", params)
|
36
36
|
end
|
37
37
|
|
38
|
+
# Generate WordPress content using AI - returns SEO optimized content with title and body
|
39
|
+
def generate_wordpress_content(**params)
|
40
|
+
get("/api/v1/generate_wordpress_content", params)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Generate social media content using AI
|
44
|
+
def generate_social_content(**params)
|
45
|
+
get("/api/v1/generate_social_content", params)
|
46
|
+
end
|
47
|
+
|
38
48
|
def keywords_search_volume(**params)
|
39
49
|
get("/api/v1/keywords_search_volume", params)
|
40
50
|
end
|
data/lib/fetchserp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fetchserp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FetchSERP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A lightweight Ruby client for interacting with the FetchSERP API. Provides
|
14
14
|
helpers for authentication and convenient Ruby methods for each endpoint.
|