{"id":22769717,"url":"https://github.com/bfontaine/sq","last_synced_at":"2025-07-02T20:36:30.520Z","repository":{"id":13115390,"uuid":"15797126","full_name":"bfontaine/sq","owner":"bfontaine","description":":page_facing_up: Bulk PDFs downloader","archived":false,"fork":false,"pushed_at":"2015-10-14T10:25:28.000Z","size":346,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T06:20:51.472Z","etag":null,"topics":["cli","pdf","ruby","tool"],"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/bfontaine.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":"2014-01-10T12:04:24.000Z","updated_at":"2019-10-26T07:14:43.000Z","dependencies_parsed_at":"2022-08-28T12:11:24.420Z","dependency_job_id":null,"html_url":"https://github.com/bfontaine/sq","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fsq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fsq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fsq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fsq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfontaine","download_url":"https://codeload.github.com/bfontaine/sq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248883892,"owners_count":21177302,"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":["cli","pdf","ruby","tool"],"created_at":"2024-12-11T15:14:28.279Z","updated_at":"2025-04-15T03:15:46.045Z","avatar_url":"https://github.com/bfontaine.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sq\n\n[![Build Status](https://travis-ci.org/bfontaine/sq.png?branch=master)](https://travis-ci.org/bfontaine/sq)\n[![Gem Version](https://badge.fury.io/rb/sq.png)](http://badge.fury.io/rb/sq)\n[![Coverage Status](https://coveralls.io/repos/bfontaine/sq/badge.png)](https://coveralls.io/r/bfontaine/sq)\n[![Inline docs](http://inch-ci.org/github/bfontaine/sq.png)](http://inch-ci.org/github/bfontaine/sq)\n\n**sq** is a web scrapping tool for PDFs. Give it an URL and an optional regex,\nand it’ll download all PDFs linked on it.\n\n## Install\n\n```\ngem install sq\n```\n\n## Usage\n\nFrom the command-line:\n\n```\n$ sq [-o \u003cdirectory\u003e] [-F \u003cformat\u003e] \u003curl\u003e [\u003cregex\u003e]\n```\n\nAvailable options:\n\n- `-F`: output format (see below), default is `%s.pdf`\n- `-o`: choose the output directory\n- `-V`: be more verbose\n- `--formats`: list available formats\n\nThe regex is case-sensitive and is matched against the whole URL.\n\n### Examples\n\n```sh\n# Get all PDFs from a Web page\nsq http://liafa.fr/~yunes/cours/interfaces/\n\n# Use a regexp to get only those you want\nsq http://liafa.fr/~yunes/cours/interfaces/ 'fiches/\\d+'\n\n# Be more verbose\nsq -V http://liafa.fr/~yunes/cours/interfaces/ 'fiches/\\d+'\n\n# Add a filename format\nsq -V http://liafa.fr/~yunes/cours/interfaces/ 'fiches/\\d+' -F 'class-%Z.pdf'\n```\n\n### Formats\n\nThe output format is used for each PDF filename. It’s a string with zero or\nmore special strings that will be replaced by a special value.\n\n```\n%n - PDF number, starting at 0\n%N - PDF number, starting at 1\n%z - same as %n, but zero-padded\n%Z - same as %N, but zero-padded\n%c - total number of PDFs\n%s - name of the PDF, extracted from its URI, without `.pdf`\n%S - name of the PDF, extracted from the link text\n%_ - same as %S, but spaces are replaced with underscores\n%- - same as %S, but spaces are replaced with hyphens\n%% - litteral %\n```\n\n## API\n\nIn a Ruby file:\n\n```ruby\nrequire 'sq'\n\nurls = SQ.query('http://example.com', /important/i)\n```\n\n## Tests\n\n```\n$ git clone https://github.com/bfontaine/sq.git\n$ cd sq\n$ bundle install\n$ rake test\n```\n\nIt’ll generate a `coverage/index.html`, which you can open in a Web browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fsq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfontaine%2Fsq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fsq/lists"}