Created
August 13, 2021 11:58
-
-
Save devbyray/84e6fd4b402ebcd703d161f01f16986a to your computer and use it in GitHub Desktop.
Get Curation Status from Medium Post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
if(__APOLLO_STATE__) { | |
let result = null | |
for(const [key, value] of Object.entries(__APOLLO_STATE__)) { | |
if(key.startsWith('Post') && value.hasOwnProperty('curationStatus')) { | |
result = 'Curation status: ' + value.curationStatus; | |
console.log(result) | |
} | |
} | |
result = result ?? 'No Curation information is found 😢' | |
alert(result) | |
} else { | |
alert('Are you sure you are currently on a Medium post?') | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment