Reputation: 25
Im using worldweatheronline api for current weather temp for 150 cities
I need to update the temperature every 1 hour for every 150 cities,
My links to update this are like this
mydomain.com/update/current.php?city=1
mydomain.com/update/current.php?city=2
...
mydomain.com/update/current.php?city=150
I think adding 150 cronjobs is not a good idea, also the limit for api calls is 3 calls for every second, so this can be a problem too.
I need your help on this, thank you.
Upvotes: 0
Views: 501
Reputation: 4111
if the current.php
is specific for cron job. (i think,it's a good idea to seperate cron jobs program from others). just call it without parameter and do a loop for different $city
inside the PHP program
Upvotes: 1
Reputation: 59987
Why not
#!/bin/bash
for X in 1 .. 150
do
mydomain.com/update/current.php?city=$X
done
For the cron job
Upvotes: 1