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

How do i get only the url to the meme? #55

Closed
v3rtual opened this issue Jul 29, 2020 · 5 comments
Closed

How do i get only the url to the meme? #55

v3rtual opened this issue Jul 29, 2020 · 5 comments
Assignees

Comments

@v3rtual
Copy link

v3rtual commented Jul 29, 2020

im trying to make an app where you can easily get memes, and i need only the url for the image of the meme. how do i do this?

@D3vd
Copy link
Owner

D3vd commented Jul 29, 2020

Hey,

The response is in the form of JSON so you can just use the url key to get the value.

@v3rtual
Copy link
Author

v3rtual commented Jul 29, 2020

how? do i just put something like https://meme-api.herokuapp.com/gimme/memes/1/url ?

@D3vd
Copy link
Owner

D3vd commented Jul 29, 2020

Nope, it has to be done on your code. What language are using?

@D3vd
Copy link
Owner

D3vd commented Jul 29, 2020

This is how you would do it in python.

import requests

response = requests.get("https://meme-api.herokuapp.com/gimme/memes").json()

print(response["url"])

@D3vd D3vd self-assigned this Jul 29, 2020
@D3vd D3vd closed this as completed Aug 4, 2020
@3top1a
Copy link

3top1a commented Aug 4, 2020

Just spent like 2 hours making a regex. F

urls = (re.findall('https://i.redd.it/.*.[jpg|png]\"', html))

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

No branches or pull requests

3 participants