Comments (11)
I would suggest it has something to do with it not being a valid image extension. Edit your URLs so you always end in something like /badge.png like the badges for pypipins do.
from pypipins.
Ah yeah I will try.
from pypipins.
Now the problem is in the route. Because I want the URL in route, flask won't be able to tell if the format is part of the URL or not.
Example:
http://sopins.herokuapp.com/twitter/png/https://www.google.com
to
http://sopins.herokuapp.com/twitter/https://www.google.com.png
Any way to get around that?
from pypipins.
Your URL scheme is totally messed up. Try using this, for example.
@app.route('/facebook/<fb_type>/<path:url>/pin.<format>', methods=['GET'])
@app.route('/<generator>/<path:url>/pin.<format>', methods=['GET'])
In your URL formatting you had format
in the wrong place, you can't change the routing the way you were trying to do it without changing where the arguments are set in the scheme.
The reason you have to return some kind of MIME type at the end of the image URL is because not all browsers, caching systems etc will cache the result (like GitHubs caching layer) based on the Content-Type MIME without the image having a valid MIME extension.
from pypipins.
That makes sense. But this still doesn't seem to work for some reason (karan/sopins@2da6ff2).
from pypipins.
I cloned your repository and tested those lines myself before I wrote my response, so they really do work. I'll do a pull request of my changes for you.
from pypipins.
Pull request done. As a note, your code was looking for badge.<extension>
but were trying to access pin.<extension>
from pypipins.
I'm not sure what you are referring to, but in my latest commit, on this line https://github.com/karan/sopins/blob/2da6ff2126a932477e5ce9caa027f020c7014302/pins.py#L95 I look for pin.<format>
. then in my README, I refer the same URL, but the CDN fails to get the image.
I tried your PR too, but it doesn't seem to work on Github.
from pypipins.
You're returning an invalid content-type header.
GET /twitter/https://kura.io/pin.png HTTP/1.1
Host: sopins.herokuapp.com
HTTP/1.1 200 OK
Content-Type: png
Date: Sat, 07 Jun 2014 20:00:43 GMT
Server: gunicorn/18.0
Content-Length: 1149
Connection: keep-alive
from pypipins.
Oh crap. Well that fixed it. Thanks
from pypipins.
Any time.
from pypipins.
Related Issues (20)
- PyPI Pins not loading badges HOT 6
- Badges do not update with GitHubs caching HOT 1
- Add badge for supported Python versions HOT 2
- Badge shape/size, rounded corners gone HOT 3
- Question: caching? HOT 1
- No badges are working. HOT 3
- add package to pypi HOT 3
- load config from ENV or config file HOT 1
- Badges not working HOT 1
- Invalid package version HOT 2
- Rewrite in something more suitable for the scale and traffic
- Service appears to be down HOT 2
- Switch to flat badges by default HOT 2
- Images are broken HOT 1
- python versions are listed multiple times in the badges HOT 2
- Badges not working (pypip.in down?) HOT 31
- Seems dead again HOT 3
- pypip.in down? HOT 7
- Getting 502 Bad gateway on all badges HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypipins.