{"id":20687037,"url":"https://github.com/shreyanjain9/bskyrb","last_synced_at":"2025-08-22T03:31:57.482Z","repository":{"id":153300830,"uuid":"628873780","full_name":"ShreyanJain9/bskyrb","owner":"ShreyanJain9","description":"Ruby Gem for interacting with BlueSky/AT Protocol","archived":false,"fork":false,"pushed_at":"2024-03-24T05:14:34.000Z","size":459,"stargazers_count":56,"open_issues_count":1,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-20T08:08:41.354Z","etag":null,"topics":["atproto","atprotocol","bluesky","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShreyanJain9.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-04-17T06:52:21.000Z","updated_at":"2024-12-09T15:09:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"3e1d1443-088d-4fc1-9596-f931ca71b923","html_url":"https://github.com/ShreyanJain9/bskyrb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShreyanJain9%2Fbskyrb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShreyanJain9%2Fbskyrb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShreyanJain9%2Fbskyrb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShreyanJain9%2Fbskyrb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShreyanJain9","download_url":"https://codeload.github.com/ShreyanJain9/bskyrb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230554330,"owners_count":18244234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atproto","atprotocol","bluesky","ruby"],"created_at":"2024-11-16T22:55:35.164Z","updated_at":"2024-12-20T08:08:45.788Z","avatar_url":"https://github.com/ShreyanJain9.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bskyrb\n![](https://img.shields.io/github/actions/workflow/status/ShreyanJain9/bskyrb/ruby.yml?style=plastic)\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Development](#development)\n- [Code generation](#code-generation)\n  - [Type checking](#type-checking)\n  - [Tests](#tests)\n  - [Formatting](#formatting)\n- [Contributing](#contributing)\n  - [TODO](#todo)\n- [Contributors](#contributors)\n- [License](#license)\n- [Code of Conduct](#code-of-conduct)\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add bskyrb\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install bskyrb\n    \nYou can also install the gem by cloning this repository and running `./install-local.sh`.\n\n\n## Usage\n\nCreate a new session:\n\n```ruby\nrequire 'bskyrb'\nusername = 'your_username'\npassword = 'your_password'\npds_url = 'https://bsky.social'\n\ncredentials = Bskyrb::Credentials.new(username, password)\nsession = Bskyrb::Session.new(credentials, pds_url)\nbsky = Bskyrb::RecordManager.new(session)\npost_uri = bsky.create_post(\"Hello world from bskyrb!\")[\"uri\"]\nbsky.like(post_uri)\nbsky.repost(post_uri)\nbsky.create_reply(post_uri, \"Replying to post from bskyrb\")\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, run `./deploy.sh` and you will be guided through updating the version number, bundling the gem, and pushing it to RubyGems. You must be signed in with a RubyGems account that has push access to bskyrb.\n\nAnd configure the type checker:\n\n## Code generation\n\nWe are working on a script to generate classes from the atproto lexicon. So far we have made non-query objects. To recreate them:\n\n```\ngit submodule add https://github.com/bluesky-social/atproto.git\n# or just clone it!\nbin/codegen\n```\n\nThis crawls the lexicon directory in your newly-cloned atproto repo, and generates formatted classes based on the json schemas embedded in the files. You can then hydrate them like so:\n\n```ruby\n# make your RecordManager, then...\n\npost_by_url = manager.get_post_by_url(\"https://staging.bsky.app/profile/naia.bsky.social/post/3jszsrnruws27\")\n\nmy_post = Bskyrb::AppBskyFeedDefs::PostView.from_hash post_by_url[\"thread\"][\"post\"]\n\n=\u003e\n#\u003cBskyrb::AppBskyFeedDefs::PostView:0x000000010432a0a0\n @author=\n  {\"did\"=\u003e\"did:plc:scx5mrfxxrqlfzkjcpbt3xfr\",\n   \"handle\"=\u003e\"naia.bsky.social\",\n   \"displayName\"=\u003e\"naia\",\n   \"avatar\"=\u003e\n    \"https://cdn.bsky.social/imgproxy/0uv5pCOimHKw44PfnCt5_XpnOICHz1KeHCl8dknI_ZY/rs:fill:1000:1000:1:0/plain/bafkreibabes4xznjzdwxqj4hzirg7lofhl2detvabroibakewssfkr\n      \"alt\"=\u003e\"\"}]},\n @indexedAt=\"2023-04-10T16:51:21.391Z\",\n @labels=[],\n @likeCount=27,\n @record=\n  {\"text\"=\u003e\"gm from the new deck chair i built yesterday\\n\\nthe sky is very blue\",\n   \"$type\"=\u003e\"app.bsky.feed.post\",\n   \"embed\"=\u003e\n    {\"$type\"=\u003e\"app.bsky.embed.images\",\n     \"images\"=\u003e\n      [{\"alt\"=\u003e\"\",\n        \"image\"=\u003e{\"$type\"=\u003e\"blob\", \"ref\"=\u003e{\"$link\"=\u003e\"bafkreif52k6kev6xgy2ydptub5oryss3gsscajrec6zh5r2els4si2yj7i\"}, \"mimeType\"=\u003e\"image/jpeg\", \"size\"=\u003e796921}}]},\n   \"createdAt\"=\u003e\"2023-04-10T16:51:21.049Z\"},\n @replyCount=4,\n @repostCount=2,\n @uri=\"at://did:plc:scx5mrfxxrqlfzkjcpbt3xfr/app.bsky.feed.post/3jszsrnruws27\",\n @viewer={}\u003e\n```\n\nNext steps:\n\n- Recursion--hydrate the classes embedded in the classes. Some parsing to enable this already happens in `LexiconParser`.\n- Generate classes for queries and other unusual object types.\n- Integrate our new classes into the API call methods.\n\n### Type checking\n\nbskyrb uses [.rbs type definitions](https://github.com/ruby/rbs). To check for accuracy, run `bin/typecheck`. Not all of the output will be useful, especially during rapid development, but it is a good idea to have types at least for the bluesky objects.\n\nUse the [`rbs collection` tool](https://github.com/ruby/rbs/blob/master/docs/collection.md) to manage definitions for third-party dependencies, for example HTTParty. Use `bundle exec rbs collection install` to download third-party definitions (**you will need to do this before `bin/typecheck` will work**).\n\n### Tests\n\nRun the test suite with:\n\n    $ bundle exec rake test\n\n### Formatting\n\nSo nobody has to argue about formatting, bskyrb uses the `standard` gem. Run `bin/format` to format the code in this repo.\n\n## Contributing\n\nPlease do!\n\n### TODO\n\n- Build\n- More/better tests\n- (Eventually) Publish/release pipeline\n- Split into separate modules for XRPC, Lexicon, ATProto, etc\n\n## Contributors\n\n\u003ca href=\"https://github.com/ShreyanJain9/bskyrb/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=ShreyanJain9/bskyrb\" /\u003e\n\u003c/a\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Bskyrb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/bskyrb/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyanjain9%2Fbskyrb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshreyanjain9%2Fbskyrb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyanjain9%2Fbskyrb/lists"}