Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hiya :), this is what I am currently using to select servers in countries, without downloading the whole API #300

Open
christopherreay opened this issue Jul 6, 2023 · 4 comments

Comments

@christopherreay
Copy link
Contributor

christopherreay commented Jul 6, 2023

get recommended server for country name

  • this could easily be memoized, and selected by either two letter code or country name from the JSON in a source file
  • obvs Im passing the returned recommended server to openpyn
countryName=$1

if [ -z $countryName ]
then
  countryName="Germany"
  countryID=81
else
  countryID=`curl --silent "https://api.nordvpn.com/v1/servers/countries" | jq --raw-output 'map(del(.cities)) | .[] | select(.name == '\"$countryName\"') | .id'`
fi
echo "{ \"countryName\": \"$countryName\", \"countryID\": $countryID }"  >&2


curl --silent https://nordvpn.com/wp-admin/admin-ajax.php -G -d "action=servers_recommendations&filters={%22country_id%22:$countryID}" | jq .[0].hostname -r | sed 's/\.nordvpn\.com$//' | cut -d'.' -f1

do you want me to code something like this up for openpyn?

@ickam
Copy link

ickam commented Sep 4, 2023

Seems like @jotyGill is MIA, so if you'd fork this project, and resolve #297 you'd be doing a lot of people a massive favour @christopherreay
I know I would love it.

@christopherreay
Copy link
Contributor Author

Yes, ok :)

Which one of us is holding the fishing pole. lol.

OK, Ill sort that out. Gimme until next week to squish it into my schedule, and we'll write up something for the community. Can you give me a hand with the community stuff?

Thanks Marek.

@ickam
Copy link

ickam commented Sep 5, 2023

What kind of help would you like? I am a somewhat passive user of github, as my understanding of code is extremely limited.
Having said that, if I can help, I most definitely shall. :)

@ickam
Copy link

ickam commented Dec 5, 2023

@christopherreay any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants