You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//return ALL available questions for a given user//window.ACCESS_TOKEN required for API call_OKCP.getApiAnswers=asyncfunction(userId){constanswers=[];constparams={api: 1,type: "GET"};letcursor='';letend=false;do{//must be async loop to get cursor from each responseconstpath=`/profile/${userId}/answers?after=${cursor}`;const{data, paging}=awaitwindow.OkC.api(path,params);if(!data||!paging){returnanswers;//bad response: bail. This is very rare. }answers.push(...data);cursor=paging.cursors.after;end=paging.end;}while(!end)returnanswers;}
This is presumably similar to whats happening when you scroll down on the new questions page and it loads more answers.
I have a monkeypatch method of incorporating this on my fork that sort of makes your parser function think its still reading HTML. Not something I think that should be used in production though.
No more HTML requests/scraping!
This is presumably similar to whats happening when you scroll down on the new questions page and it loads more answers.
I have a monkeypatch method of incorporating this on my fork that sort of makes your parser function think its still reading HTML. Not something I think that should be used in production though.
window.OkC
is from the actual okcapi.js, attained from okcupid.com.https://github.com/JakeIwen/chrome-okc-plugin/blob/master/plugin/okcapi.js
Sorry fo lack of pull request, but I fear anything I make could have unforeseen (on my part) consequences / errors.
The text was updated successfully, but these errors were encountered: