- الخطوة 1
- الاسم ، تاريخ الميلاد ، المدينة. وفقًا لهذه الحقول ، نحن نبحث عن مطابقات بين حسابات فكونتاكتي التي تحتوي على صور. في حالة عثورنا على حسابين أو أكثر ، نستخدم الحساب مع آخر تاريخ تسجيل دخول كحد أقصى. إذا لم يتم العثور على شيء ، فانتقل إلى الخطوة 2.
- الخطوة 2
- باستخدام البيانات حسب الاسم الأخير والاسم الأول وتاريخ الميلاد ، نعيد البحث.
إذا وجدنا حسابين أو أكثر ، فانتقل إلى الخطوة 3.2. إذا لم يتم العثور على شيء ، انتقل إلى الخطوة 3.3.
- الخطوة 3
- نحن نبحث عن المجموعات ال 10 الأكثر شعبية في مدينة فكونتاكتي المختارة.
- في هذه المجموعات ، نبحث عن FI ، تاريخ الميلاد ، بلد روسيا ، هناك صورة. إذا تم العثور على شيء ما ، فاحفظ النتيجة الحالية ، وإلا انتقل إلى الخطوة 3.3.
- نحن نبحث عن مجموعات من FI ، بلد روسيا ، هناك صورة. إذا تم العثور على شيء ما ، فإننا نحفظ النتيجة ، وإلا فإنه "فارغ".
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;