VKontakte - Khanty

Some of the people in the photos on this page might not be Khanty, or they might be for example Mansi, Nenetses, or ethnic Russians.

I scraped the results of search pages (like https://vk.com/search?c%5Blang%5D=372&c%5Bphoto%5D=1&c%5Bsection%5D=people) to find users who had included the Khanty language as a language they speak. Most of the users returned by the search are fake accounts, but the ones that are not are usually easy to spot.

I used a script like this to make a list of the friends of users:

while read userid;do
  curl -s "https://api.vk.com/method/friends.get?user_id=$userid&fields=sex,first_name,last_name,bdate,city,country"|jq -r '.response[]?|(.user_id|tostring)+";"+(.sex|tostring)'|sed "s/^/$userid;/"
done

I considered a user as likely to be Khanty if the user was friends with many users who I had marked as possibly Khanty and was not friends with more users who I had marked as possibly belonging to some other Russian minority.

I used a script like this to make a list of the profile pictures of users:

while read userid;do
  curl -s "https://api.vk.com/method/photos.get?owner_id=$userid&album_id=profile"|jq -r '.response[]?|objects|(.owner_id|tostring)+";"+(.pid|tostring)+";"+(.src_xxxbig//.src_xxbig//.src_xbig//.src_big//.src)'
done

I then selected users based on their profile pictures, and I used a script like this to make a list of all pictures posted by the users who I had selected:

while read userid;do
  curl -s "https://api.vk.com/method/photos.getAlbums?owner_id=$userid&count=1000&need_system=1"|jq '.response[]?.aid'|while read l;do
    o=0
    while :;do
      c=$(curl -s "https://api.vk.com/method/photos.get?owner_id=$userid&album_id=$l&count=1000&offset=$o")
      jq -r '.response[]?|objects|(.owner_id|tostring)+";"+(.pid|tostring)+";"+(.src_xxxbig//.src_xxbig//.src_xbig//.src_big//.src)'<<<"$c"|sed s/\$/\;$l/
      jq -e '.response|length<1000'<<<"$c">/dev/null&&break
      let o+=1000
    done
  done
done