{"id":15590435,"url":"https://github.com/coderberry/grabz_it","last_synced_at":"2025-04-24T05:34:40.342Z","repository":{"id":4465767,"uuid":"5604539","full_name":"coderberry/grabz_it","owner":"coderberry","description":"Ruby interface to the GrabzIt (grabz.it) service","archived":false,"fork":false,"pushed_at":"2015-02-16T21:44:53.000Z","size":312,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-30T07:22:49.488Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/coderberry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-29T18:13:41.000Z","updated_at":"2019-07-19T17:22:40.000Z","dependencies_parsed_at":"2022-09-13T17:51:17.234Z","dependency_job_id":null,"html_url":"https://github.com/coderberry/grabz_it","commit_stats":null,"previous_names":["cavneb/grabz_it"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fgrabz_it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fgrabz_it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fgrabz_it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fgrabz_it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderberry","download_url":"https://codeload.github.com/coderberry/grabz_it/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250572661,"owners_count":21452334,"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-10-02T23:21:58.873Z","updated_at":"2025-04-24T05:34:40.324Z","avatar_url":"https://github.com/coderberry.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GrabzIt\n\nInterfaces with the GrabzIt screenshot service (http://grabz.it)\n\n**This is not the official version of the GrabzIt Ruby Gem. If you want the latest official version please visit: http://grabz.it/api/ruby/download.aspx**\n\nYard docs can be found at http://www.rubydoc.info/github/cavneb/grabz_it/master/frames\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'grabz_it'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install grabz_it\n    \n## Dependencies\n* [rspec](https://github.com/rspec/rspec) (used in tests only)\n\n## Usage\n\n### Save Picture\n\nCalls the GrabzIt web service to take the screenshot and saves it to the target path provided. \n\n*Warning, this is a SYNCHONOUS method and can take up to 5 minutes before a response.*\n\n```ruby\nclient = GrabzIt::Client.new('TEST_KEY', 'TEST_SECRET')\noptions = {\n  :url            =\u003e 'http://grabz.it',\n  :callback_url   =\u003e 'http://example.com/callback',\n  :browser_width  =\u003e 1024,\n  :browser_height =\u003e 768,\n  :output_width   =\u003e 800,\n  :output_height  =\u003e 600,\n  :custom_id      =\u003e '12345',\n  :format         =\u003e 'png',\n  :delay          =\u003e 1000\n}\nclient.save_picture('/tmp/my_picture.png', options)\n\nputs File.exists?('/tmp/my_picture.png')\n# =\u003e true\n```\n\n### Take Picture\n\nCalls the GrabzIt web service to take the screenshot. It will optionally ping a callback url with the custom id if provided.\n\n```ruby\nclient = GrabzIt::Client.new('TEST_KEY', 'TEST_SECRET')\noptions = {\n  :url            =\u003e 'http://grabz.it',\n  :callback_url   =\u003e 'http://example.com/callback',\n  :browser_width  =\u003e 1024,\n  :browser_height =\u003e 768,\n  :output_width   =\u003e 800,\n  :output_height  =\u003e 600,\n  :custom_id      =\u003e '12345',\n  :format         =\u003e 'png',\n  :delay          =\u003e 1000\n}\nresponse = client.take_picture(options)\n\nputs response.screenshot_id\n# =\u003e 'Y2F2bmViQGdtYWlsLmNvbQ==-20943258e37c4fc28c4977cd76c40f58'\n```\n\n### Get Picture\n\nGet the screenshot image\n\n```ruby\nclient = GrabzIt::Client.new('TEST_KEY', 'TEST_SECRET')\nimage = client.get_image('Y2F2bmViQGdtYWlsLmNvbQ==-20943258e37c4fc28c4977cd76c40f58')\n\nputs image.content_type\n# =\u003e 'image/png'\nputs image.size\n# =\u003e 129347\n\nimage.save(\"/tmp/myimage.png\")\nFile.exist?(\"/tmp/myimage.png\")\n# =\u003e true\n```\n\n### Get Status\n\nGet the current status of a GrabzIt screenshot.\n\n```ruby\nclient = GrabzIt::Client.new('TEST_KEY', 'TEST_SECRET')\nstatus = client.get_status('Y2F2bmViQGdtYWlsLmNvbQ==-20943258e37c4fc28c4977cd76c40f58')\n\nputs status.failed?\n# =\u003e false\nputs status.available?\n# =\u003e true\n```\n\n### Get Cookie Jar\n\nGet all the cookies that GrabzIt is using for a particular domain. This may include your user set cookies as well.\n\n```ruby\nclient = GrabzIt::Client.new('TEST_KEY', 'TEST_SECRET')\ncookie_jar = client.get_cookie_jar('google')\n\nputs cookie_jar.cookies.count\n# =\u003e 3\nputs cookie_jar.cookies[0].name\n# =\u003e 'secure'\nputs cookie_jar.cookies[0].domain\n# =\u003e 'accounts.google.com'\n```\n\n## TODO\n\n* Create the ability to set and delete cookies.\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 'Added 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%2Fcoderberry%2Fgrabz_it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderberry%2Fgrabz_it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderberry%2Fgrabz_it/lists"}