Page MenuHomePhabricator

Get URL of actual pronunciation audio file instead of File page
Closed, ResolvedPublic


Example (title pronunciation for Neptune):

Parsoid gives us:

<span typeof="mw:Image" data-mw="{&quot;caption&quot;:&quot;Listen&quot;}"><a href="//"><img resource="./File:Speakerlink-new.svg" src="//" data-file-width="11" data-file-height="11" data-file-type="drawing" height="11" width="11"></a></span>


  1. We could look for the first occurrence of <span typeof="mw:Image" data-mw="{&quot;caption&quot;:&quot;Listen&quot;}">.

A selector like 'span[typeof*=Image][data-mw*=caption][data-mw*=Listen] a' should work. I ran into issues getting a selector for the exact strings of these attributes. If anyone knows how, please let me know.

  1. Make an extra request to MW API

Event Timeline

bearND created this task.Nov 6 2015, 5:21 AM
bearND raised the priority of this task from to High.
bearND updated the task description. (Show Details)
bearND added a project: Mobile-Content-Service.
bearND moved this task to Backlog on the Mobile-Content-Service board.
bearND added a subscriber: bearND.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 6 2015, 5:21 AM
bearND set Security to None.
bearND moved this task from Backlog to Doing on the Mobile-Content-Service board.

Change 252448 had a related patch set uploaded (by Niedzielski):
Use pronunciation file URL instead of page URL

Change 252448 merged by jenkins-bot:
Use pronunciation file URL instead of page URL

@Niedzielski I noticed after merging that this doesn't get title pronunciations in all cases.
See http://localhost:6927/ as an example.

In general I find this list useful for testing:

@bearND, the pronunciation icon only shows for articles that have an audio file. I don't see one for Oxford.

My bad. You are correct. I'm moving it back to ready for sign off.

bearND moved this task from Code Review to To Deploy on the Mobile-Content-Service board.
bearND closed this task as Resolved.Nov 18 2015, 6:43 PM