{"id":18137982,"url":"https://github.com/rickbutton/snapcat","last_synced_at":"2025-04-19T17:44:18.650Z","repository":{"id":13329703,"uuid":"16016610","full_name":"rickbutton/snapcat","owner":"rickbutton","description":"A Ruby wrapper for the Snapchat API. Meow.","archived":false,"fork":false,"pushed_at":"2014-01-19T05:09:06.000Z","size":589,"stargazers_count":0,"open_issues_count":0,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T11:04:26.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":false,"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/rickbutton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-18T01:18:32.000Z","updated_at":"2019-07-30T07:57:45.000Z","dependencies_parsed_at":"2022-09-23T11:50:34.691Z","dependency_job_id":null,"html_url":"https://github.com/rickbutton/snapcat","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/rickbutton%2Fsnapcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickbutton%2Fsnapcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickbutton%2Fsnapcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickbutton%2Fsnapcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rickbutton","download_url":"https://codeload.github.com/rickbutton/snapcat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249751803,"owners_count":21320375,"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":[],"created_at":"2024-11-01T15:07:54.457Z","updated_at":"2025-04-19T17:44:18.628Z","avatar_url":"https://github.com/rickbutton.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Snapcat\n=======\n[![Build Status](https://travis-ci.org/nneal/snapcat.png)](https://travis-ci.org/nneal/snapcat)\n\n\nA cat-tastic Ruby wrapper for the [Snapchat](http://snapchat.com) private API.\nMeow. This gem is designed to give you a friendly Ruby-like interface for\ninteracting with the Snapchat API.\n\n\nInstallation\n------------\n\nAdd this line to your application's `Gemfile`:\n\n    gem 'snapcat', '~\u003e 0.1.0'\n\nAnd then execute:\n\n    $ bundle\n\nAlternatively, install it via command line:\n\n    $ gem install snapcat\n\n\nUsage\n-----\n\n**User Auth**\n\n```ruby\n# Initialize a client and login\nsnapcat = Snapcat::Client.new('your-username')\nsnapcat.login('topsecretpassword')\n\n# Initialize a new client, register, and login\nsnapcat = Snapcat::Client.new('your-new-username')\nsnapcat.register('topsecretpassword', '1990-01-20', 'test@example.com')\n\n# Logout\nsnapcat.logout\n```\n\n\n**User Actions**\n\n```ruby\n# Block a user\nsnapcat.block('username-to-block')\n\n# Clear feed\nsnapcat.clear_feed\n\n# Fetch a user's updates\nsnapcat.fetch_updates\n\n# Unblock a user\nsnapcat.unblock('username-to-unlock')\n\n# Update user's email\nsnapcat.update_email('newemail@example.com')\n\n# Update user's privacy setting\n# Two choices:\n#   Snapcat::User::Privacy::EVERYONE\n#   Snapcat::User::Privacy::FRIENDS\nsnapcat.update_privacy(Snapcat::User::Privacy::EVERYONE)\n\n# Pro tip:\n#   Every call to the API responds with Snapcat::Response object with which\n#   you can check a few important things\nresponse = snapcat.block('username-to-block')\nresponse.code # =\u003e 200\nresponse.http_success # =\u003e true\nresponse.data # =\u003e { logged: true, ... }\n```\n\n**User Data**\n\n```ruby\n# Get the user\nuser = snapcat.user\n\n# Examine all raw user data\nuser.data\n\n# Examine snaps received\nuser.snaps_received\n\n# Examine snaps sent\nuser.snaps_sent\n\n# Examine friends\nuser.friends\n```\n\n**Friends**\n\n```ruby\n# Add a new friend\nsnapcat.add_friend('mybestbuddy')\n\n# Grab a friend\nfriend = user.friends.first\n\n# Set a friend's display name\nsnapcat.set_display_name(friend.username, 'Nik Ro')\n\n# Delete a friend :(\nsnapcat.delete_friend(friend.username)\n\n# Learn more about your friend\nfriend.can_see_custom_stories\nfriend.display_name\nfriend.username\n\n# What kind of friend are they anyway??\nfriend.type\nfriend.type.confirmed?\nfriend.type.unconfirmed?\nfriend.type.blocked?\nfriend.type.deleted?\n```\n\n**Sending Snaps**\n\n```ruby\n# Send it to catsaregreat with 3 seconds duration\n# `data` is a string which can be read directly from an mp4 or jpg\nsnapcat.send_media(data, 'catsaregreat')\n\n# Or send it to multiple recipients and override default view_duration\nsnapcat.send_media(data, %w(catsaregreat ronnie99), view_duration: 4)\n```\n\n**Received Snaps**\n\n```ruby\n# Grab a snap\nsnap = user.snaps_received.first\n\n# Get the snap image or video data\nmedia_response = snapcat.media_for(snap.id)\nmedia = media_response.data[:media]\n\n# Record a view\nsnapcat.view(snap.id)\n\n# Record a screenshot\nsnapcat.screenshot(snap.id)\n\n# Record a screenshot\n\n# Learn more about the media\nmedia.image?\nmedia.video?\nmedia.file_extension\nmedia.type_code\n\n# Get the data from the media object\nmedia.to_s\n```\n\n**Snaps General**\n\n```ruby\n# Learn more about the snap\nsnap.broadcast\nsnap.broadcast_action_text\nsnap.broadcast_hide_timer\nsnap.broadcast_url\nsnap.screenshot_count\nsnap.media_id\nsnap.id\nsnap.media_type\nsnap.recipient\nsnap.sender\nsnap.status\nsnap.sent\nsnap.opened\n```\n\n**Advanced User Auth**\n\nThe standard `login` method will log out all other sessions. If you want to use\nSnapcat in multiple concurrent processes, you need to share this token across\nprocesses and set it manually.\n\n```ruby\n# Fetch token\nsnapcat.client.auth_token\n\n# Set token\nsnapcat.client.auth_token = '1c7e8f83-1379-4694-8fa9-4cab6b73f0d4'\n```\n\n\nContributing\n------------\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Add tests and make sure they pass\n6. Create new Pull Request\n\n\nCredits\n-------\n\n* [Neal Kemp](http://nealke.mp)\n* Based on work by martinp on [pysnap](https://github.com/martinp/pysnap) and by\n  djstelles on [php-snapchat](https://github.com/dstelljes/php-snapchat)\n\nCopyright \u0026copy; 2013 Neal Kemp\n\nReleased under the MIT License, which can be found in the repository in `LICENSE.txt`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickbutton%2Fsnapcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frickbutton%2Fsnapcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickbutton%2Fsnapcat/lists"}