Skip to content

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

@christopherreay

Description

@christopherreay

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions