spencermountain / wtf_wikipedia

a pretty-committed wikipedia markup parser
https://observablehq.com/@spencermountain/wtf_wikipedia
MIT License
770 stars 129 forks source link

Poly-fill is needed! #545

Closed MarketingPip closed 1 year ago

MarketingPip commented 1 year ago

Issue

A poly-fill is needed for this to work on older devices / models of devices. Such as iPhone 6.

Environment: Safari Device: iPhone 6

Maybe in browser based version's use a poly service URL as import. You will need to go through all import's etc.

As far as I do know this should solve the problem.

ps; check this out OnThisDay.js - you made this library possible. Hoping to work on / have you help with a upcoming library that uses this & compromise. Awesome work man! Keep it up.

MarketingPip commented 1 year ago

This work's on iPhone 6 Safari - only when wrapping in a async function tho.

import "https://unpkg.com/wtf_wikipedia@10.1.5/builds/wtf_wikipedia-client.min.js"

let works = wtf.fetch('Radiohead', {'Api-User-Agent': 'Name your script here'})

// Works only when using / wrapping in async function. 
async function example(){
console.log(await works)
}
example()

Can't seem to pin point the issue. But hoping to get some insight @spencermountain.

MarketingPip commented 1 year ago

Closing this issue due to me being a noob, seems you can only use await wrapped in function on iOS 6 Safari. Feel free to re-open this if any input / things to add to this.

spencermountain commented 1 year ago

hey cool! Yeah - I have a hard time following the status of these async changes, too. Your guess is as good as mine. Happy to change anything. Using the Days of the year pages for this is really clever. Have you found them to be parsable? I have ambitions to produce a similar dataset by crawling through the wikipedia dump. Would love to know more about what you're building cheers

MarketingPip commented 1 year ago

hey cool! Yeah - I have a hard time following the status of these async changes, too. Your guess is as good as mine. Happy to change anything. Using the Days of the year pages for this is really clever. Have you found them to be parsable? I have ambitions to produce a similar dataset by crawling through the wikipedia dump. Would love to know more about what you're building cheers

@spencermountain - they are fairly easy to parse! Tho I did make one slip up that needs fixed in Regex match. Adding support for different languages / pages ASAP.

And I will be adding you in possibly to private / public repo - I want you thoughts + hoping to maybe get the mastermind behind this (you) and some opinons. Tho I think you will LOVE it. And will suite amazing for collecting some data for everyone (plus Compromise etc) - hoping to contribute soon myself - or make a library with out of box / easy to use API that uses Compromise for NER.

So again < hoping to have you on board + get some input / ideas on what things should be changed etc. Tho (hold off on building a DB till you see what I am working on - I promise it'll be good!).