{"id":13629815,"url":"https://github.com/producthunt/ShareMeow","last_synced_at":"2025-04-17T09:36:42.948Z","repository":{"id":1871763,"uuid":"44924684","full_name":"producthunt/ShareMeow","owner":"producthunt","description":":heart_eyes_cat: text shots service","archived":true,"fork":false,"pushed_at":"2023-02-01T21:33:12.000Z","size":11189,"stargazers_count":188,"open_issues_count":2,"forks_count":18,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-11-08T20:46:29.244Z","etag":null,"topics":["emoji","image","ruby","sharing","tweet","twitter"],"latest_commit_sha":null,"homepage":"https://www.producthunt.com","language":"HTML","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/producthunt.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2015-10-25T19:01:07.000Z","updated_at":"2024-05-19T12:16:42.000Z","dependencies_parsed_at":"2023-02-17T11:16:05.288Z","dependency_job_id":null,"html_url":"https://github.com/producthunt/ShareMeow","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/producthunt%2FShareMeow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/producthunt%2FShareMeow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/producthunt%2FShareMeow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/producthunt%2FShareMeow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/producthunt","download_url":"https://codeload.github.com/producthunt/ShareMeow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249331996,"owners_count":21252674,"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":["emoji","image","ruby","sharing","tweet","twitter"],"created_at":"2024-08-01T22:01:20.526Z","updated_at":"2025-04-17T09:36:40.843Z","avatar_url":"https://github.com/producthunt.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"## ShareMeow\n[![Build\nStatus](https://travis-ci.org/producthunt/ShareMeow.svg?branch=master)](https://travis-ci.org/producthunt/ShareMeow)\n[![Code\nClimate](https://codeclimate.com/github/producthunt/ShareMeow/badges/gpa.svg)](https://codeclimate.com/github/producthunt/ShareMeow)\n[![Test\nCoverage](https://codeclimate.com/github/producthunt/ShareMeow/badges/coverage.svg)](https://codeclimate.com/github/producthunt/ShareMeow/coverage)\n[![Dependency Status](https://dependencyci.com/github/producthunt/ShareMeow/badge)](https://dependencyci.com/github/producthunt/ShareMeow)\n\nShareMeow is a Ruby microservice (ooh ahh) for creating super shareable, tweetable,\nfacebook-able images from your content :heart_eyes_cat:. You define a template (using HTML/CSS),\npass it some parameters, and it will generate an image to you.\n\nIt's what we use at [Product Hunt](https://www.producthunt.com) for making beautiful tweets like this:\n\n\u003cimg width='375px' src=\"https://camo.githubusercontent.com/5bed0906f5c6bd07c843246f0baccd0e8fe03b2b/68747470733a2f2f7062732e7477696d672e636f6d2f6d656469612f4356564445454f5641414164396a362e6a7067\" alt=\"ShareMeow Preview Image\" data-canonical-src=\"https://pbs.twimg.com/media/CVVDEEOVAAAd9j6.jpg\" style=\"max-width:100%;\"\u003e\n\n## Features:\n- Supports Emoji :100::heart_eyes_cat::sparkles:\n- Custom fonts\n- Cachable images (throw cloudflare infront of it \u0026 you're good to go)\n- signed URLs via hmac digest\n\n## Getting Started\nFor a quick introduction to how to use ShareMeow, take a [look\nat this excellent screencast by GoRails](https://gorails.com/episodes/sharemeow).\n\n[![ShareMeow\nScreencast](http://img.youtube.com/vi/lcMuFj3EGb4/0.jpg)](https://gorails.com/episodes/sharemeow)\n\n## The API\n\n#### GET `/v1/:encoded_params/:encoded_hmac_digest/image.jpg`\nThis generates and returns a jpg.\n\nRequired params are determined by the image template you're using.\n\nIf you're using Ruby, you can use the [ShareMeow Ruby Client](https://github.com/producthunt/ShareMeowClient) for generating URLs easily.\n\nIf you'd rather not use the client. Here is an example of how to generate the URL in Ruby.\n\n```Ruby\nrequire 'base64'\nrequire 'json'\nrequire 'openssl'\n\njson_params = { template: 'HelloWorld', message: 'Hello' }.to_json\n\nencoded_params = Base64.urlsafe_encode64(json_params)\nhmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), 'your_secret_key', encoded_params)\nhmac_digest = Base64.urlsafe_encode64([hmac].pack('H*'))\n\nimage_url = \"https://your-share-meow.herokuapp.com/v1/#{ encoded_params }/#{ hmac_digest }/image.jpg\"\n\n\n# =\u003e \"https://your-share-meow.herokuapp.com/v1/eyJ0ZW1wbGF0ZSI6IkhlbGxvV29ybGQiLCJtZXNzYWdlIjoiSGVsbG8ifQ==/-lgitNQmEs9NaiWyOCHeV137D80=/image.jpg\"\n```\n\n## Deploy\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/producthunt/ShareMeow)\n\n\n## Authentication :closed_lock_with_key:\nShareMeow uses URLs signed with an HMAC signature to ensure that only people with a secret key are able to generate URLs with your service.\n\nIt works like this:\n\nConvert your parameters to JSON. Then [Base64 URL Safe encode](https://en.wikipedia.org/wiki/Base64#URL_applications) them. There are libraries available to do this in all major languages.\n\n```Ruby\n# Ruby\nparams = { template: 'HelloWorld', message: 'Hello, World' }\njson_params = params.to_json\n\nencoded_params = Base64.urlsafe_encode64(json_params)\n```\n\nThen create the HMAC signature from the encoded params and your secret key. Finish by packing and base64 encoding the signature (we do this to keep the URL shorter)\n\n```Ruby\nhmac_signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), 'your_secret_key', encoded_params)\nencoded_hmac = Base64.urlsafe_encode64([hmac_signature].pack('H*'))\n```\n\nWhen ShareMeow gets your request, it will recreate the HMAC signature using the encoded params/secret key. If it matches the signature you provided, it will generate the image. :star:\n\n## Templates\nTake a look here for example templates: https://github.com/producthunt/ShareMeow/tree/master/app/image_templates.\n\n#### Custom Fonts\nHere is example css using a font from [Google Fonts](https://www.google.com/fonts).\n\n```css\n@font-face {\n  font-family: 'Roboto';\n  font-style: normal;\n  font-weight: 400;\n  src: local('Roboto Regular'), local('Roboto-Regular'), url(https://themes.googleusercontent.com/static/fonts/roboto/v10/2UX7WLTfW3W8TclTUvlFyQ.woff) format('woff');\n}\n```\n\n#### Emoji :sparkles:\nIf you'd like to render emoji, you can use the `EmojiHelper` in your templates. It converts both unicode emoji and GitHub/Slack (`:smile:`) style emoji to images. Can do this by overriding `render_options`.\n\n```Ruby\n# images_templates/your_template.rb\nrequire 'app/emoji_helper'\n\nmodule ImageTemplates\n  class YourTemplate \u003c Base\n    def render_options\n      @options[:content] = EmojiHelper.emojify(@options[:content])\n      super\n    end\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bundle install` to install dependencies. Then, run `rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nStart the server:\n`$ puma`\n\n## Contributing :heart:\n\nWant to make this better? Great! :smile:\n\nBug reports and pull requests are welcome on GitHub at https://github.com/producthunt/ShareMeow. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproducthunt%2FShareMeow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproducthunt%2FShareMeow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproducthunt%2FShareMeow/lists"}