Page MenuHomePhabricator

Create specialised content API for mobile apps
Closed, ResolvedPublic

Description

The mobile apps currently do a lot of client-side transformations of the HTML they receive from the MobileFrontend API. This includes things like moving bits of content around, applying new CSS, or even discarding large amounts of HTML that we don't want to display to the user because it's not appropriate for a mobile experience (e.g. navigation boxes).

There are a few problems with this, such as increased network usage because we're discarding up to half (!!) of the HTML the API gives us since we don't need it, and bad user-perceived performance while the user waits for the client to transform the page.

It would be nice if an API could be created that would allow the mobile apps to receive exactly the HTML that they need, without having to do transforms or receive unwanted stuff.

Event Timeline

Deskana raised the priority of this task from to Needs Triage.
Deskana updated the task description. (Show Details)
Deskana subscribed.
Deskana updated the task description. (Show Details)
Deskana added a subscriber: GWicke.

AFAIK this should be made possible by the deployment of RESTBase. @GWicke can correct me if I'm wrong. :-)

@mobrovac Sounds good to me! One question, though: is the intention for this to provide all the metadata about articles that we use, such as Wikidata descriptions? The API currently provides those to us.

@Dbrant @Mhurd @dr0ptp4kt: Comments on T87807?

Is the intention for this to provide all the metadata about articles that we use, such as Wikidata descriptions? The API currently provides those to us.

Hopefully, we'll get there eventually. As a matter of fact, we are talking to Wikidata guys about providing an easy-to-use API for their services (see T85181). In the meantime, we can surely find a workaround (IMHO, the current WDQ should be more than enough).

I addition to the article data and the transforms/exclusions mentioned above, the meta data for the article's images is needed. Presently we're having to do separate chained requests for this data. It would be *amazing* if we could get image meta data, article data, and certain wikidata, all in a single request per article.

(Note: Presently we do get the article wikidata description with the mobileview request, but it's possible additional fields will be needed in the near future.)

It would be great if we could totally generalize the kind of Wikidata data we receive in the mobileview response. i.e. instead of just specifying "description", we could specify something like "wdprops=description|instanceof", or indeed "wdprops=*"

@mobrovac Maybe I've misread your comment. But I want to make sure you are aware that we're already getting Widata descriptions channeled through the MW API on Wikipedia (list=pageterms).
Example: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&prop=pageterms&format=json&titles=Obama&redirects=

@Dbrant Either that. Or maybe have a new action, called "mobileapp", which is similar to mobileview but tuned for our needs in the Android and iOS apps. OK, if RESTBase does the same or better, that sounds great to me as well.

@mobrovac Maybe I've misread your comment. But I want to make sure you are aware that we're already getting Widata descriptions channeled through the MW API on Wikipedia (list=pageterms).

Yup, I thought so. What I meant with the comment was more in the following senses:

  • have a unified API for mobiles
  • allow further exploration of terms once the public Wikidata API is in place

But, I realise these are not short-term goals.

@bearND @Dbrant @Mhurd @Deskana @GWicke @Jdouglas let's set up a meeting and discuss this further? Today? Monday?

@mobrovac Sure, do you want to set it up since you know better than I what the agenda should be?

Ok, you should all have an invite for tomorrow morning (PST).

Notes from today's meeting are available here

Yes, this could be considered resolved.

GWicke claimed this task.