How do I increment an integer in an URL? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionDownload all source files for a webpageBash - how to make explicit operator precedence without creating a subshellDownload Forum AttachmentsBash: Convert a string (version number) to an integerHow to get a substring based on index of another stringStoring stderr output in a variable without modifing stdout, and doing so repeatedlyFind where a javascript button redirects to through a bash scriptHow to curl full web page content?Generating quoted command argumentsWhat HTTP request and response headers do `curl --cert` and `curl --cacert` read and write?
What causes the vertical darker bands in my photo?
3 doors, three guards, one stone
How to find out what spells would be useless to a blind NPC spellcaster?
What exactly is a "Meth" in Altered Carbon?
Can a non-EU citizen traveling with me come with me through the EU passport line?
Why is my conclusion inconsistent with the van't Hoff equation?
Apollo command module space walk?
What does an IRS interview request entail when called in to verify expenses for a sole proprietor small business?
What would be the ideal power source for a cybernetic eye?
Is the Standard Deduction better than Itemized when both are the same amount?
51k Euros annually for a family of 4 in Berlin: Is it enough?
What does the word "veer" mean here?
What does the "x" in "x86" represent?
Echoing a tail command produces unexpected output?
ListPlot join points by nearest neighbor rather than order
String `!23` is replaced with `docker` in command line
Do I really need recursive chmod to restrict access to a folder?
2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?
English words in a non-english sci-fi novel
At the end of Thor: Ragnarok why don't the Asgardians turn and head for the Bifrost as per their original plan?
Fundamental Solution of the Pell Equation
Use BFD on a Virtual-Template Interface
Bete Noir -- no dairy
Using audio cues to encourage good posture
How do I increment an integer in an URL?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionDownload all source files for a webpageBash - how to make explicit operator precedence without creating a subshellDownload Forum AttachmentsBash: Convert a string (version number) to an integerHow to get a substring based on index of another stringStoring stderr output in a variable without modifing stdout, and doing so repeatedlyFind where a javascript button redirects to through a bash scriptHow to curl full web page content?Generating quoted command argumentsWhat HTTP request and response headers do `curl --cert` and `curl --cacert` read and write?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want to scrape a forum by using an API and curl.
API:
https://api.hackertarget.com/pagelinks/?q=websitetotest.com
Here is the initial link:
https://bitcointalk.org/index.php?topic=840124.0
Desired outcome:
https://bitcointalk.org/index.php?topic=840124.20
I need to be able to do this all the way up to 4,240
https://bitcointalk.org/index.php?topic=840124.4240
As you can see, the only integer that changes is after the dot.
bash scripting curl
New contributor
bupera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I want to scrape a forum by using an API and curl.
API:
https://api.hackertarget.com/pagelinks/?q=websitetotest.com
Here is the initial link:
https://bitcointalk.org/index.php?topic=840124.0
Desired outcome:
https://bitcointalk.org/index.php?topic=840124.20
I need to be able to do this all the way up to 4,240
https://bitcointalk.org/index.php?topic=840124.4240
As you can see, the only integer that changes is after the dot.
bash scripting curl
New contributor
bupera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I want to scrape a forum by using an API and curl.
API:
https://api.hackertarget.com/pagelinks/?q=websitetotest.com
Here is the initial link:
https://bitcointalk.org/index.php?topic=840124.0
Desired outcome:
https://bitcointalk.org/index.php?topic=840124.20
I need to be able to do this all the way up to 4,240
https://bitcointalk.org/index.php?topic=840124.4240
As you can see, the only integer that changes is after the dot.
bash scripting curl
New contributor
bupera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I want to scrape a forum by using an API and curl.
API:
https://api.hackertarget.com/pagelinks/?q=websitetotest.com
Here is the initial link:
https://bitcointalk.org/index.php?topic=840124.0
Desired outcome:
https://bitcointalk.org/index.php?topic=840124.20
I need to be able to do this all the way up to 4,240
https://bitcointalk.org/index.php?topic=840124.4240
As you can see, the only integer that changes is after the dot.
bash scripting curl
bash scripting curl
New contributor
bupera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
bupera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
bupera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Apr 12 at 14:54
buperabupera
1
1
New contributor
bupera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
bupera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
bupera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Curl, if that's what you want to use to access the URLs, supports URLs with ranges:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240]'
Where ... are other options that you may want to use.
The range syntax also allows for stepping with another increment than 1. For example, to get every 20th URL:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240:20]'
For further information, please refer to the curl manual.
To generate a list of URL for separate processing with curl or some other program, consider using a brace expansion (if your shell supports it):
printf '%sn' 'https://bitcointalk.org/index.php?topic=840124.'0..4240
With bash and some other shells, an increment may be used as in '...URL...'0..4240..20.
The list could then be piped to e.g. xargs that could invoke your curl or other program with the URLs as arguments.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
bupera is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512124%2fhow-do-i-increment-an-integer-in-an-url%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Curl, if that's what you want to use to access the URLs, supports URLs with ranges:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240]'
Where ... are other options that you may want to use.
The range syntax also allows for stepping with another increment than 1. For example, to get every 20th URL:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240:20]'
For further information, please refer to the curl manual.
To generate a list of URL for separate processing with curl or some other program, consider using a brace expansion (if your shell supports it):
printf '%sn' 'https://bitcointalk.org/index.php?topic=840124.'0..4240
With bash and some other shells, an increment may be used as in '...URL...'0..4240..20.
The list could then be piped to e.g. xargs that could invoke your curl or other program with the URLs as arguments.
add a comment |
Curl, if that's what you want to use to access the URLs, supports URLs with ranges:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240]'
Where ... are other options that you may want to use.
The range syntax also allows for stepping with another increment than 1. For example, to get every 20th URL:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240:20]'
For further information, please refer to the curl manual.
To generate a list of URL for separate processing with curl or some other program, consider using a brace expansion (if your shell supports it):
printf '%sn' 'https://bitcointalk.org/index.php?topic=840124.'0..4240
With bash and some other shells, an increment may be used as in '...URL...'0..4240..20.
The list could then be piped to e.g. xargs that could invoke your curl or other program with the URLs as arguments.
add a comment |
Curl, if that's what you want to use to access the URLs, supports URLs with ranges:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240]'
Where ... are other options that you may want to use.
The range syntax also allows for stepping with another increment than 1. For example, to get every 20th URL:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240:20]'
For further information, please refer to the curl manual.
To generate a list of URL for separate processing with curl or some other program, consider using a brace expansion (if your shell supports it):
printf '%sn' 'https://bitcointalk.org/index.php?topic=840124.'0..4240
With bash and some other shells, an increment may be used as in '...URL...'0..4240..20.
The list could then be piped to e.g. xargs that could invoke your curl or other program with the URLs as arguments.
Curl, if that's what you want to use to access the URLs, supports URLs with ranges:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240]'
Where ... are other options that you may want to use.
The range syntax also allows for stepping with another increment than 1. For example, to get every 20th URL:
curl ... 'https://bitcointalk.org/index.php?topic=840124.[0-4240:20]'
For further information, please refer to the curl manual.
To generate a list of URL for separate processing with curl or some other program, consider using a brace expansion (if your shell supports it):
printf '%sn' 'https://bitcointalk.org/index.php?topic=840124.'0..4240
With bash and some other shells, an increment may be used as in '...URL...'0..4240..20.
The list could then be piped to e.g. xargs that could invoke your curl or other program with the URLs as arguments.
edited Apr 12 at 16:17
answered Apr 12 at 15:03
Kusalananda♦Kusalananda
142k18266441
142k18266441
add a comment |
add a comment |
bupera is a new contributor. Be nice, and check out our Code of Conduct.
bupera is a new contributor. Be nice, and check out our Code of Conduct.
bupera is a new contributor. Be nice, and check out our Code of Conduct.
bupera is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512124%2fhow-do-i-increment-an-integer-in-an-url%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown