Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to retrieve image for medium posts #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jorniks
Copy link

@jorniks jorniks commented Apr 21, 2022

This pull request loops through JSON resulting object and gets post images exposing them to postImage variable.

@ethanosullivan
Copy link
Member

Hi @jorniks, thanks for submitting an improvement to the repo. When you say "image for medium post", are you referring to Medium.com? If you can elaborate what you're trying to do and how this help, I'd appreciate it.

@jorniks
Copy link
Author

jorniks commented Apr 22, 2022

Oh sorry for my poor documentation skill. I was indeed referring to medium.com.

The body of posts on medium is packed in an XML tag name encoded which houses the images and texts of the post. I looped searched through the encoded variable in the resulting JSON object to find and pick out the first image in the post and add it to the JSON object using postImage variable.

This update will improve result efficiency for those who are interested in grabbing and displaying an image from the posts made on medium.com. Where no image is found on the post, the JSON object is not modified but returned in its original state.

@ethanosullivan
Copy link
Member

Got it, looks great. I also use this to convert my Medium feed to JSON. I ended up using regex to get the image.

Although I like this feature, it's specific to just Medium XMLs right now. I'm thinking this can be expanded to pull additional information from Medium as a new feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants