loading...

Dev To WordPress - A wordpress plugin to show your DEV posts

twitter logo github logo ・1 min read

Hello community! I've been learning some WordPress in these months and for test my knowledge untill now, I made a little widget-plugin. It shows your DEV posts in a sidebar.

GitHub logo andersonjoseph / dev-to-wordpress

A wordpress plugin to show your DEV.to posts in a widget.

dev-to-wordpress

A wordpress plugin to show your DEV.to posts.


Usage

Widget

The sidebar widget display the latest articles of the user given. You can use this widget in any widget area of your theme.

Shortcode

Use shortcodes to display a particular post. Syntax:

[devtowordpres post="https://dev.to/username/post-url-example"] 

Download

For downloads, check the latest releases. Install the .zip file from your WordPress admin panel.




DEV doesn't have an API yet, so the plugin grabs the content making requests to a hardcoded URL

This is the first thing that I done for wordpress, so contributions and feedback are totally welcome :)

twitter logo DISCUSS (4)
markdown guide
 

Hey this is a cool idea and well done! I'm curious, are you somehow passing your specific accounts auth in a request to dev.to to get you're posted articles then and parsing the response to display the articles? Since there is no API I imagine this was a little awkward to workaround?

 

Well, the articles are public so send auth credentials in requests isn't necessary. I'm only passing an user id and the number of posts to fetch. When I was learning some Node js, one of my first learning projects was a CLI for dev.to in that project I also used the same point for request articles, I found that point looking in the network logs of my browser. After a few days I was waiting for any error with the url (404 or something like that), but after 5 months, everything still working! So I used the same point for this, the response is in JSON with all the articles info. So it made me the things a little bit easier.
The awkward part is having that super-hard-coded url for fetch the articles. As soon we get an official API, I will update the code.

 
Classic DEV Post from Nov 21 '19

What are your favourite Alfred workflows?

Anderson. J profile image
Estudiante de ingeniería Back End Developer 👽

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️