- Langkah 1
- Nama, tanggal lahir, kota. Menurut bidang ini, kami mencari kecocokan di antara akun Vkontakte yang memiliki foto. Jika kami menemukan 2 akun atau lebih, kami menggunakan akun dengan maksimum tanggal login terakhir. Jika tidak ada yang ditemukan, lanjutkan ke Langkah 2.
- Langkah 2
- Menggunakan data dengan nama belakang dan nama depan, tanggal lahir, kami mencari kembali.
Jika kami menemukan 2 akun atau lebih, lanjutkan ke Langkah 3.2. Jika tidak ada yang ditemukan, lanjutkan ke Langkah 3.3.
- Langkah 3
- Kami mencari 10 grup paling populer dari kota Vkontakte terpilih.
- Dalam grup ini kami mencari FI, tanggal lahir, negara Rusia, ada foto. Jika sesuatu ditemukan, maka simpan hasil saat ini, jika tidak pergi ke langkah 3.3.
- Kami mencari grup berdasarkan FI, negara Rusia, ada foto. Jika sesuatu ditemukan, kami menyimpan hasilnya, jika tidak maka itu "kosong".
var name = Args.fullname; var birth_day = Args.birth_day; var birth_month = Args.birth_month; var birth_year = Args.birth_year; var city = Args.city; var fields = "photo_id, sex, bdate, city, country, home_town, photo_max_orig, contacts, site, education, universities, schools, status, last_seen, followers_count, common_count, occupation, nickname, relatives, relation, personal, connections, exports, activities, interests, music, movies, tv, books, games, about, quotes, can_post, can_see_all_posts, can_see_audio, can_write_private_message, can_send_friend_request, is_favorite, is_hidden_from_feed, timezone, screen_name, maiden_name, career, military"; var countGroups = 10; var res = []; var item = {}; var city_id = 0; if (city != "") { city_id = API.database.getCities({"q": city, "country_id": 1}).items@.id[0]; } if (birth_day != "" && city_id > 0) { item = API.users.search({ "q": name, "country":1, "city": city_id, "has_photo":1, "fields": fields, "birth_day": birth_day, "birth_month": birth_month, "birth_year": birth_year }).items; var i = 0; while (i < item.length) { var item_ = item[i]; item_.criterion = " , , "; item_.step = "1.1"; res.push(item_); i = i +1; } } else { countGroups = countGroups + 1; } if (item.length > 0) { return res; } if (birth_day != "") { item = API.users.search({ "q": name, "country": 1, "has_photo": 1, "fields": fields, "birth_day": birth_day, "birth_month": birth_month, "birth_year": birth_year }).items; var i = 0; while (i < item.length) { var item_ = item[i]; item_.criterion = " , "; item_.step = "2.1"; res.push(item_); i = i +1; } } if (item.length > 0) { return res; } if (city.length > 0) { var groupsIDs = API.groups.search({ "q": city, "sort": 6, "type": "page", "count": countGroups }).items@.id; var count = 0; while (count < groupsIDs.length) { var item2 = {}; if (birth_day != "") { item2 = API.users.search({ "q": name, "country":1, "has_photo":1, "fields": fields, "birth_day": birth_day, "birth_month": birth_month, "birth_year": birth_year, "group_id": groupsIDs[count] }).items; } if (item2.length > 0) { var i = 0; while (i < item2.length) { var item_ = item2[i]; item_.criterion = " , , "; item_.step = "3.2"; item_.groupID = groupsIDs[count]; res.push(item_); i = i +1; } } else { item2 = API.users.search({ "q": name, "country":1, "has_photo":1, "fields": fields, "count": 5, "group_id": groupsIDs[count] }).items; var i = 0; while (i < item2.length) { var item_ = item2[i]; item_.criterion = ", "; item_.step = "3.3"; item_.groupID = groupsIDs[count]; res.push(item_); i = i +1; } } count = count + 1; } } return res;