awk
aws convert string
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/italicDesired 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)
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