shapelessai 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 +9 -0
  3. data/README.md +16 -0
  4. data/lib/shapelessai.rb +53 -0
  5. metadata +50 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 72db0ac822acea8091befc76d192cb8a06c54bbcbc1086fca4db0e63af799e3d
4
+ data.tar.gz: 48202811cb6452bfb53c6f6e235e21ccef9385769d40f21ec003746e17ba5d39
5
+ SHA512:
6
+ metadata.gz: 97649c99a394fd284f48e3e9bab2eb0f07e493539225434697be72f8b8a03b5a48bb3e1320bc05d5c22b9c37b8ad9c5ba85cb13f3ac2a2c40d64d058b4594ac9
7
+ data.tar.gz: addfe06ccdacd22e96618b9393e0fef66997f5d3d7981ede4e639be7471aa0d3e36e20a813adde1aeeb57faaca6af3f0053e9b1b31e4d482c7d80ece3e020338
data/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ShapelessAI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
data/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # ShapelessAI for Ruby
2
+
3
+ Ruby client for [ShapelessAI](https://shapelessai.com), the AI content team that makes and publishes social posts. It lists your connected accounts, then schedules, publishes and cancels posts through the [ShapelessAI API](https://shapelessai.com/docs/api). No dependencies.
4
+
5
+ ```ruby
6
+ require "shapelessai"
7
+ client = ShapelessAI::Client.new(api_key: ENV["SHAPELESSAI_API_KEY"])
8
+ account = client.accounts["connections"].first
9
+ client.create_post(connection_id: account["id"], text: "Shipped today") # next queue slot
10
+ client.create_post(connection_id: account["id"], text: "Later", at: Time.now + 3600) # a set time
11
+ client.posts(status: "scheduled")
12
+ ```
13
+
14
+ Make an API key at https://shapelessai.com/docs/api. Agents can also use the hosted MCP server at https://shapelessai.com/mcp ([docs](https://shapelessai.com/docs/mcp)).
15
+
16
+ Made by the ShapelessAI team. MIT licence.
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+ require "json"
3
+ require "time"
4
+ require "net/http"
5
+ require "uri"
6
+
7
+ # Minimal client for https://shapelessai.com/docs/api
8
+ module ShapelessAI
9
+ VERSION = "0.1.0"
10
+ class Error < StandardError; end
11
+
12
+ class Client
13
+ def initialize(api_key: ENV["SHAPELESSAI_API_KEY"], base_url: "https://shapelessai.com")
14
+ raise Error, "Set SHAPELESSAI_API_KEY (make one at https://shapelessai.com/docs/api)" if api_key.to_s.empty?
15
+ @api_key = api_key
16
+ @base = URI(base_url)
17
+ end
18
+
19
+ def me; get("/api/me"); end
20
+ def accounts; get("/api/connections"); end
21
+ def posts(status: nil); get("/api/posts" + (status ? "?status=#{URI.encode_www_form_component(status)}" : "")); end
22
+
23
+ # Default: the account's next free queue slot. at: a Time schedules it; now: true publishes at once.
24
+ def create_post(connection_id:, text:, at: nil, now: false)
25
+ body = { connectionId: connection_id, postText: text }
26
+ if at then body[:scheduledAt] = at.utc.iso8601
27
+ elsif !now then body[:queue] = true
28
+ end
29
+ request(Net::HTTP::Post, "/api/posts", body)
30
+ end
31
+
32
+ def cancel_post(id); request(Net::HTTP::Delete, "/api/posts/#{id}"); end
33
+
34
+ private
35
+
36
+ def get(path); request(Net::HTTP::Get, path); end
37
+
38
+ def request(klass, path, body = nil)
39
+ uri = URI.join(@base.to_s, path)
40
+ req = klass.new(uri)
41
+ req["Authorization"] = "Bearer #{@api_key}"
42
+ req["Accept"] = "application/json"
43
+ if body
44
+ req["Content-Type"] = "application/json"
45
+ req.body = JSON.generate(body)
46
+ end
47
+ res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |h| h.request(req) }
48
+ data = res.body.to_s.empty? ? {} : JSON.parse(res.body)
49
+ raise Error, "#{res.code}: #{data['error'] || res.body}" unless res.is_a?(Net::HTTPSuccess)
50
+ data
51
+ end
52
+ end
53
+ end
metadata ADDED
@@ -0,0 +1,50 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shapelessai
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - ShapelessAI
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-10-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: List connected social accounts, schedule, publish and cancel posts through
14
+ the ShapelessAI API (https://shapelessai.com). No dependencies.
15
+ email: founders@shapelessai.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE
21
+ - README.md
22
+ - lib/shapelessai.rb
23
+ homepage: https://shapelessai.com
24
+ licenses:
25
+ - MIT
26
+ metadata:
27
+ homepage_uri: https://shapelessai.com
28
+ documentation_uri: https://shapelessai.com/docs/api
29
+ source_code_uri: https://github.com/FirstClassTree/shapelessai
30
+ rubygems_mfa_required: 'false'
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '2.6'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubygems_version: 3.0.3.1
47
+ signing_key:
48
+ specification_version: 4
49
+ summary: 'Ruby client for the ShapelessAI API: schedule and publish social posts'
50
+ test_files: []