awk

chevron-rightaws convert stringhashtag

Perfect ✨ You want to take a list of Lever job site URLs from websites.txt and convert them into Lever API URLs in bulk.

Your input (websites.txt):

https://jobs.lever.co/akidolabs
https://jobs.lever.co/swoopapp
https://jobs.lever.co/x-claim
http://jobs.lever.co/explodingkittens
https://jobs.lever.co/boulevard
https://jobs.lever.co/italic

Desired output:

https://api.lever.co/v0/postings/explodingkittens?mode=json
https://api.lever.co/v0/postings/boulevard?mode=json
https://api.lever.co/v0/postings/italic?mode=json

πŸ”Ή Bash one-liner (bulk transform)

cat websites.txt | awk -F'/' '{print "https://api.lever.co/v0/postings/" $4 "?mode=json"}' > api_urls.txt

βœ… Explanation:

  • -F'/' β†’ split by /

  • $4 β†’ the company name part (explodingkittens, boulevard, italic)

  • print "https://api.lever.co/v0/postings/" $4 "?mode=json" β†’ build new API URL

  • > api_urls.txt β†’ save result


πŸ”Ή Example Output (api_urls.txt)

https://api.lever.co/v0/postings/akidolabs?mode=json
https://api.lever.co/v0/postings/swoopapp?mode=json
https://api.lever.co/v0/postings/x-claim?mode=json
https://api.lever.co/v0/postings/explodingkittens?mode=json
https://api.lever.co/v0/postings/boulevard?mode=json
https://api.lever.co/v0/postings/italic?mode=json

πŸ‘‰ Do you also want me to show how to do this inside n8n (Function node) so your workflow can take websites.txt and automatically generate the API URLs for HTTP requests?

Last updated