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

fix(gatsby-source-medium): fix data fecthing & add limitation to readme #17547

Merged
merged 7 commits into from
Mar 2, 2020

Conversation

sujinjoshi
Copy link
Contributor

@sujinjoshi sujinjoshi commented Sep 11, 2019

TL;DR

Fixes the issue but limited to latest 10 posts.

Description

Fixes the issue with medium.com cloudflare ddos protection by modifying the URL from https://medium.com/${nameOfBlogHere}/latest?format=json&limit=100 to https://medium.com/${nameOfBlogHere}?format=json as suggested by @biernacki here #17335 (comment)

Limitation

This workaround would limit the number of articles returned to 10. Hence, the plugin can't be used to display all the contents from medium blog. But it would be helpful if you are displaying only last n number of blogs (where n <= 10), which is I believe how most gatsby themes using this plugin are designed.

Related Issues

Fixes #17335

@sujinjoshi sujinjoshi requested a review from a team as a code owner September 11, 2019 04:33
@sujinjoshi sujinjoshi changed the title Temporary workaround for Medium CAPTCHA issue fix(gatsby-source-medium): Temporary workaround for Medium CAPTCHA issue Sep 11, 2019
@EmaSuriano
Copy link
Contributor

This change fixes the build problem but sadly it doesn't return the same amount of posts as in the initial request. Is there any alternative to log in into Medium in order to avoid the 403?

@wardpeet
Copy link
Contributor

Thank you for taking a stab at this @sujinjoshi. I'm currently marking this as WIP as I like to get some more info on this #17335 (comment)

@LekoArts
Copy link
Contributor

Let's close this PR as long as not a definite solution is found in which direction the plugin should be headed: #17335

@sujinjoshi sujinjoshi requested a review from a team as a code owner November 12, 2019 21:17
@LekoArts LekoArts added status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response and removed status: WIP labels Nov 26, 2019
LekoArts
LekoArts previously approved these changes Nov 26, 2019
Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a technical standpoint, @gatsbyjs/learning should look at the README change.

omonk
omonk previously approved these changes Nov 26, 2019
EmaSuriano
EmaSuriano previously approved these changes Nov 26, 2019
Copy link
Contributor

@EmaSuriano EmaSuriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it seems that the team of Medium is not going to fix this issue and in the current state of the plugin, it doesn't work at all ...

@omonk omonk dismissed stale reviews from EmaSuriano, LekoArts, and themself via 4865ed3 November 26, 2019 09:01
@LekoArts LekoArts requested a review from a team January 8, 2020 12:31
Copy link
Contributor

@laurieontech laurieontech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this additional information. Good to know the limitations. One minor grammar change but other than that looks good to me.

packages/gatsby-source-medium/README.md Outdated Show resolved Hide resolved
Co-Authored-By: LB <laurie@gatsbyjs.com>
@wardpeet wardpeet changed the title fix(gatsby-source-medium): Temporary workaround for Medium CAPTCHA issue fix(gatsby-source-medium): fix data fecthing & add limitation to readme Feb 29, 2020
wardpeet
wardpeet previously approved these changes Feb 29, 2020
Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, this is the best we can do. Thanks a ton! 💯

@laurieontech
Copy link
Contributor

Thanks for the dialogue on this everyone! Going to get this merged.

@laurieontech laurieontech merged commit 3ba9f9c into gatsbyjs:master Mar 2, 2020
@Crayon-ShinChan
Copy link

I tested a medium account with 4 articles.gatsby-source-medium didn't return the number of articles it should have return. It just returned totalCount: 3, which should be 4. Additionally, I tested an account with 9 articles, it just returned 4 articles.

Then I tried to use https://medium.com/${nameOfBlogHere}/?format=json&limit=10. There were just 3 posts not 4. How can this happen?

@laurieontech
Copy link
Contributor

@Crayon-ShinChan Can you please open a bug with as much duplication information as possible? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gatsby-source-medium] Plugin fails due to new medium cloudflare ddos prevention
7 participants