feat(flickr): extract the profile's linked social accounts - #568
Open
brunolm wants to merge 1 commit into
Open
Conversation
The /people/ page carries dedicated fields for the accounts a profile links elsewhere β facebook, instagram, pinterest, tumblr, twitter β plus occupation. Each populated field is emitted under its own platform-named key, holding the bare handle Flickr stores rather than a constructed URL. The photostream page the verdict rests on omits these fields, so they come from a second, best-effort request made only once an account is confirmed; a failure there leaves the previous extra untouched. That page embeds a person model per contact, so the public-profile object is matched on the owner's NSID instead of taken by position.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Flickr profile carries dedicated fields for five other platforms β
facebook,instagram,twitter,tumblr,pinterestβ plusoccupation.validate_flickrextracted none of them.Each value names an account on a different site, which is what turns a hit from "this handle exists here" into a lead.
This needs a second request, contrary to what it looks like
The module fetches
/photos/{user}. The social fields are not on that page at all β they live only in theperson-public-profile-modelsblock served by/people/{nsid}/. A page-wide search of/photos/thomashawkforfacebook/instagram/tumblrreturns only Flickr's own SDK config.So the enrichment is a second, best-effort request made only after the account is already confirmed found, in the same shape as
stripchat._api_profileandcamsoda._broadcaster_profile. The verdict path is unchanged: a blocked or restructured/people/page costs metadata, never a verdict, and a miss never triggers the extra request.Extraction is anchored to the owner, because the page embeds 34 other people
/people/51035555243@N01/carries 35 person models β the owner plus 34 contacts, with 25 distinctrealnameand 25 distinctpathAliasvalues belonging to other users. Taking the first match, or sweeping the document, would attribute a stranger's Instagram to the scanned account.The lookup matches on the owner's NSID, taken from the already-verified photostream owner:
Running the same lookup with each of the 34 contact NSIDs returns
{}in every case, and each emitted handle agrees with its*Urlsibling in the matched object. Addressing the request by NSID also makes the whole thing casing-proof βThomasHawkandthomashawkreturn identical output.Handles are stored bare, not as URLs
Flickr stores
"thomashawk", nothttps://twitter.com/thomashawk, and the values pass through unchanged rather than being expanded into a guessed URL shape per platform.Testing
Verified live against a profile with all five fields set, one with only
occupation, one with none (keys absent, not empty strings), both casings of the same handle, the NSID form, and a nonexistent handle (unchangedavailable).Not verified
No profile was found whose social fields contain a full URL rather than a bare handle. If such an account exists the value passes through as-is, but there is no live example to confirm the shape.