Page MenuHomePhabricator

Have a dedicated route for link previews
Closed, ResolvedPublic

Description

The overlap between what we need for the lead section and previews is not as big as originally anticipated. It's better to reduce the payload size. Eventually we should be able to take advantage of T117082, but that one is not implemented yet.

Event Timeline

bearND created this task.Nov 9 2015, 7:56 AM
bearND claimed this task.
bearND raised the priority of this task from to Normal.
bearND updated the task description. (Show Details)
bearND added a project: Mobile-Content-Service.
bearND moved this task to Doing on the Mobile-Content-Service board.
bearND added a subscriber: bearND.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 9 2015, 7:56 AM

Change 251926 had a related patch set uploaded (by BearND):
Add route for mobile-preview

https://gerrit.wikimedia.org/r/251926

bearND added a comment.EditedNov 9 2015, 4:58 PM

Example output:

{
    "title": "Dog",
    "extract": "The domestic dog is a domesticated canid which has been selectively bred for millennia for various behaviors, sensory capabilities, and physical attributes. Although initially thought to have originated as a manmade variant of an extant canid species, extensive genetic studies undertaken during the 2010s indicate that dogs diverged from an extinct wolf-like canid in Eurasia 40,000 years ago.",
    "thumbnail": {
        "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Collage_of_Nine_Dogs.jpg/320px-Collage_of_Nine_Dogs.jpg"
    },
    "infobox": [
    [
        [
            "Class:",
            "<span class=\"class\" style=\"white-space:nowrap;\"><a href=\"/wiki/Mammal\">Mammalia</a></span>"
        ],
        [
            "Order:",
            "<span class=\"order\" style=\"white-space:nowrap;\"><a href=\"/wiki/Carnivora\">Carnivora</a></span>"
        ],
        [
            "Family:",
            "<span class=\"family\" style=\"white-space:nowrap;\"><a href=\"/wiki/Canidae\">Canidae</a></span>"
        ],
        [
            "Genus:",
            "<span class=\"genus\" style=\"white-space:nowrap;\"><i><a href=\"/wiki/Canis\">Canis</a></i></span>"
        ],
    ]
}

Skipped some of the infobox entries, to not make this comment too long.

So is this meant to exist only temporarily? If so, the task should be declined - we cannot have public API changes often. As an alternative, I'd propose to keep the current payload in the lead section endpoint and then thin it out once T117082 has been completed. On the client side, it could check for certain elements in the response, and if they are missing - make a request to the summary endpoint.

Change 251926 merged by Mobrovac:
Add route for mobile-summary

https://gerrit.wikimedia.org/r/251926

Change 253558 had a related patch set uploaded (by BearND):
Retrofit link preview requests

https://gerrit.wikimedia.org/r/253558

Change 253558 merged by jenkins-bot:
Retrofit link preview requests

https://gerrit.wikimedia.org/r/253558

bearND closed this task as Resolved.Nov 18 2015, 6:43 PM