{"id":21944758,"url":"https://github.com/browserstack/ruby-screenshots","last_synced_at":"2025-08-20T20:31:50.901Z","repository":{"id":8008329,"uuid":"9416368","full_name":"browserstack/ruby-screenshots","owner":"browserstack","description":"Ruby Wrapper for BrowserStack Screenshots API","archived":false,"fork":false,"pushed_at":"2023-09-28T08:03:27.000Z","size":23,"stargazers_count":34,"open_issues_count":5,"forks_count":16,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-08-09T20:17:06.928Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.browserstack.com/screenshots","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/browserstack.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-13T16:20:52.000Z","updated_at":"2023-06-21T11:50:39.000Z","dependencies_parsed_at":"2024-06-21T04:11:30.983Z","dependency_job_id":null,"html_url":"https://github.com/browserstack/ruby-screenshots","commit_stats":{"total_commits":30,"total_committers":8,"mean_commits":3.75,"dds":0.4666666666666667,"last_synced_commit":"e43fd20963a7fce46233eb604a9730923a250d7d"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/browserstack/ruby-screenshots","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fruby-screenshots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fruby-screenshots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fruby-screenshots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fruby-screenshots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserstack","download_url":"https://codeload.github.com/browserstack/ruby-screenshots/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fruby-screenshots/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271378680,"owners_count":24749192,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-29T04:17:03.558Z","updated_at":"2025-08-20T20:31:50.519Z","avatar_url":"https://github.com/browserstack.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BrowserStack Screenshots\n\nA ruby gem for [BrowserStack](http://browserstack.com)'s [Screenshot](http://browserstack.com/screenshots) [API](http://www.browserstack.com/screenshots/api).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'browserstack-screenshot'\n\nAnd then execute:\n\n    bundle\n\nOr install it yourself as:\n\n    gem install browserstack-screenshot\n\n## Example of Use\n\nFirst, you need to require the screenshot gem:\n\n``` ruby\nrequire 'screenshot'\n```\n\n### Creating Client\nCreates a new client instance.\n\n* `settings`: A hash of settings that apply to all requests for the new client.\n  * `:username`: The username for the BrowserStack account.\n  * `:password`: The password for the BrowserStack account.\n\n``` ruby\nsettings = {:username =\u003e \"foo\", :password =\u003e \"foobar\"}\nclient = Screenshot::Client.new(settings)\n```\n\n###API\n\n####Getting available os and browsers\nFetches all available browsers. [API info](http://www.browserstack.com/screenshots/api#list-os-browsers)\n\n``` ruby\nclient.get_os_and_browsers \t#returns a hash\n```\n\n####Generating Screenshots\nFrame the config object according to the format given. [Format info](http://www.browserstack.com/screenshots/api#generate-screenshots)\n\nEg settings object:\n``` ruby\nparams = {\n\t:url =\u003e \"www.google.com\",\n\t:callback_url =\u003e \"http://example.com/pingback_url\",\n\t:win_res =\u003e \"1024x768\",\t\t#Options : \"1024x768\", \"1280x1024\"\n\t:mac_res =\u003e \"1920x1080\", \t#Options : \"1024x768\", \"1280x960\", \"1280x1024\", \"1600x1200\", \"1920x1080\"\n\t:quality =\u003e \"compressed\",\t#Options : \"compressed\", \"original\"\n\t:wait_time =\u003e 5,          \t#Options: 2, 5, 10, 15, 20, 60\n\t:orientation =\u003e \"portrait\", #Options: \"portrait\", \"landscape\"\n\t:tunnel =\u003e false,\n\t:browsers =\u003e [\n\t\t\t{:os=\u003e\"Windows\",:os_version=\u003e\"7\",:browser=\u003e\"ie\",:browser_version=\u003e\"8.0\"},\n\t\t\t{:os=\u003e\"Windows\",:os_version=\u003e\"XP\",:browser=\u003e\"ie\",:browser_version=\u003e\"7.0\"}\n\t]\n}\n```\n`callback_url`, `win_res`, `mac_res`, `quality`, `wait_time`, `orientation` and `tunnel` being optional parameters.\n\n#####For testing Local/Internal Server setup\n* First setup local tunnel using the command line method as mentioned [here](http://www.browserstack.com/local-testing#setup)\n* Pass `:tunnel =\u003e true` in the params object\n\n\n\nA request id is returned when a valid request is made.\n\n``` ruby\nrequest_id = client.generate_screenshots params\n```\n\n####Checking/Polling the status of the request\nUse this method to check if the requested screenshots are complete. \n``` ruby\nclient.screenshots_done? request_id\t#returns `true` or `false`\n```\n\nOr you can fetch the request state\n``` ruby\nclient.screenshots_status request_id\t#returns `queue` or `processing` or `done`\n```\n\n####Fetching the response of the requested screenshots\n``` ruby\nclient.screenshots request_id\n```\n\n\n## Contributing\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. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fruby-screenshots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserstack%2Fruby-screenshots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fruby-screenshots/lists"}