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
// setup and request credentialsletcredential=Credential.create("Devto","Enter your Dev.to username and API key.");credential.addTextField("username","Username");credential.addPasswordField("api_key","Dev.to API Key");credential.authorize();constkey=credential.getValue("api_key");constusername=credential.getValue("username");// make postletendpoint=`https://dev.to/api/articles`;// configure post details// for more information, see:// https://developers.forem.com/apiletdata={"article":
{"title": draft.displayTitle,"body_markdown": draft.content,"tags": draft.tags,"published": "false",}};// create and post HTTP requestvarhttp=HTTP.create();varresponse=http.request({"url": endpoint,"method": "POST","data": data,"headers": {"Content-Type": "application/json","api-key": key,}});Object.keys(response.responseText);vartadCon=newTadConsole("/Library/Scripts/tadcon.json");tadCon.TA_addEntry(response.responseText);tadCon.TA_saveLog();// log result post URL and copy to clipboardconsole.log(response.responseText);app.setClipboard(response.responseText);draft.setTemplateTag("devdata",response.responseText);/*else { console.log("Dev.to Error: " + response.error); context.fail();}*/
The text was updated successfully, but these errors were encountered:
extratone
changed the title
# Post to Dev.to Action
Post to Dev.to Action
May 3, 2022
Post to Dev.to Action
Description
Post draft contents on Dev.to.
The text was updated successfully, but these errors were encountered: