summaryrefslogtreecommitdiff
path: root/blp
blob: 8ad30c40c4f3423c820b964e6a48b7e5e9dfd846 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

sed -n 's/ID: //p' |
while read id
do
	# Retrieve authorization token
	tok=`curl -s "https://www.blocket.se/annons/a/b/$id" | awk '/id="initialState"/ {getline; print}' | jq -r .authentication.bearerToken`

	# Retrieve phone number
	curl -s -H "authorization: Bearer $tok" "https://api.blocket.se/search_bff/v1/content/$id/phone_numbers" | jq -r .phone_number
done