Skip to content

update to retrieve image for medium posts#10

Open
jorniks wants to merge 1 commit intojinksraevan:masterfrom
jorniks:mediumImageBranch
Open

update to retrieve image for medium posts#10
jorniks wants to merge 1 commit intojinksraevan:masterfrom
jorniks:mediumImageBranch

Conversation

@jorniks
Copy link
Copy Markdown

@jorniks jorniks commented Apr 21, 2022

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

@jinksraevan
Copy link
Copy Markdown
Owner

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
Copy Markdown
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.

@jinksraevan
Copy link
Copy Markdown
Owner

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.

2 participants