import generator from 'megalodon' ; export const getClientForInstance = ( instanceUrl , accessToken ? ) => generator ( 'mastodon' , instanceUrl , accessToken ) ; export const registerNuclear = ( instanceUrl ) => { const client = getClientForInstance ( instanceUrl ) ; return client . registerApp ( 'Nuclear Music Player' , { website : 'https://nuclear.js.org/' } ) ; } ; export const getAccessToken = ( instanceUrl , clientId , clientSecret , authorizationCode ) => { const client = getClientForInstance ( instanceUrl ) ; return client . fetchAccessToken ( clientId , clientSecret , authorizationCode ) ; } ; export const post = ( instanceUrl , accessToken , content ) => { const client = getClientForInstance ( instanceUrl , accessToken ) ; return client . postStatus ( content ) ; } ;