def if_defined(data, key, callback):
if key in data and data[key]:
+ print key, data[key]
callback(data[key])
friends_data = self._get_friends_data()
self._friends_without_contact.add(friend)
for url in friend.get_urls():
- self._friends_by_url[url] = friend
+ if self.is_profile_url(url):
+ self._friends_by_url[url] = friend
if self._allow_friend_to_match_by_name(friend):
key = canonical(friend.get_name())
# -----------------------------------------------------------------------
+ def is_profile_url(self, url):
+ """Return True if this is a URL for this service."""
+
+ return url and "facebook.com" in url
+
+
+ # -----------------------------------------------------------------------
def _allow_friend_to_match_by_name(self, friend):
for url in friend.get_urls():
if url in self._known_urls: