game-icons / icons

All SVG icons available on https://game-icons.net
Other
1.05k stars 115 forks source link

Suggestion: Hotlinking API #533

Open kaisalmon opened 5 years ago

kaisalmon commented 5 years ago

I don't know anything about how game-icons is hosted, so do not know if this financially feasible, but it would be very convenient to have an API accessible that served:

It is currently possible to do hack this together this with raw scraping, of course, but that feels inconsiderate at best, and it would be nice to know if the powers that be approve of this idea. Additionally it would be possible to limit downloads on a "per icon per IP per hour" basis, to encourage caching/local downloads being made within applications utilizing the API

aloisdg commented 4 years ago

bump !

JestDotty commented 3 years ago

looking for the same

I've also noticed there's little descriptions for each icon and comments. I have a use for the descriptions if I could.

an icon lookup could contain information such as: name, author, license, description

I've noticed this service in particular allows you to specify the colors of its assets, could be pretty nice to have as well: https://shields.io edit: oh, you can sort of it do it now with https://game-icons.net/icons/ffffff/000000/1x1/lorc/eagle-emblem.svg edit 2: but only with black or whites

kaisalmon commented 3 years ago

@JestDotty Hotlinking without permission is considered, at the very least, very rude ¹².

The other downside is because that is dependent on how the server happens to store (or, more accurately, serve) the files, it could change at any moment without the developer realising he is breaking live projects.

An API would serve as a contract between game-icon's developer(s) and 3rd party developers, massively reducing the chance of breaking changes occurring. Additionally putting hard limits would encourage caching to reduce "stolen" bandwidth.

Finally, without a convenient way to list all available icons any 3rd party applications cannot easily provide users with a list of icons which update when game-icons updates.

(Also, I suggested this 2 years ago, I don't think it's going to happen. I suggest just downloading all the files onto your own server and occasionally doing manual updates)

JestDotty commented 3 years ago

It wasn't for the purpose of hotlinking. I wanted to quickly download all the icons and tags for something instead of having to manually tag them (and I needed it in a reverse color scheme).

I can still do so with scraping probably, which while technically illegal, is currently a booming job title that even pops up on paid for job postings probably due to all the corona economical changes, and tons of people being out of jobs.

You're rude. I read your message fine. I'm also no longer stuck on this problem, turns out a fan base will do manual work for you out of love so problem solved. And there's lots of ways of preventing what you're talking about, but I'm not here to lecture people about my ideals. I figured I was contributing. My bad.

On Thu, Feb 18, 2021, 8:13 AM kaisalmon notifications@github.com wrote:

@JestDotty https://github.com/JestDotty Hotlinking without permission is considered, at the very least, very rude ¹ https://awesomelytechie.com/dont-hotlink/² https://webmasters.stackexchange.com/questions/25315/hotlinking-what-is-it-and-why-shouldnt-people-do-it .

The other downside is because that is dependent on how the server happens to store (or, more accurately, serve) the files, it could change at any moment without the developer realising he is breaking live projects.

An API would serve as a contract between game-icon's developer(s) and 3rd party developers, massively reducing the chance of breaking changes occurring. Additionally putting hard limits would encourage caching to reduce "stolen" bandwidth.

Finally, without a convenient way to list all available icons any 3rd party applications cannot easily provide users with a list of icons which update when game-icons updates.

(Also, I suggested this 2 years ago, I don't think it's going to happen. I suggest just downloading all the files onto your own server and occasionally doing manual updates)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/game-icons/icons/issues/533#issuecomment-781334432, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABECY4D7B6AEIAYFYZ5TW5TS7UHA3ANCNFSM4FQAU3JQ .

aloisdg commented 3 years ago

Well an api would resolve this issue.

Delapouite commented 3 years ago

Hello folks

Sorry to have let this issue rot without a clear answer about these questions.

A bit of context to start with.

I've been running game-icons.net alone for about 10 years now, as a side project during evening and week ends. The initial vision (which stays relevant to this day) was to help game designers find nice icons for their prototype.

When Lorc first published on reddit his set of 700 icons, they were unnamed and in PNG. So my first involvement was simply to extract them as individual SVG and give them a name. Finally, I published them in the form of a static website which is hosted on my server, that is financed entirely on my personal savings. There's no big company running the show, just a random dude in France who happily wants to help give away icons for free, in the true meaning of the term. No "Patreon", no "ads", no "sponsors", no "crowd sourcing". Just giving for the satisfaction to contribute a tiny bit of good vibes.

At first, I thought people would simply visit the site, pick a handful of icons they need and start crafting neat games or art. But as you can guess, then another type of users appeared, wanting to have them ALL. To rebundle them as dedicated libraries (Unity, Unreal engine, Illustrator stamps), to create fonts… There are many legitimate reasons to do so. Or sometimes, they just have a Pokemon hunter "completionist" mindset ;)

If you already visited other websites providing icons (I won't mention any particular names but I'm sure you already know a lot of them), this simple feature of "grabbing them all" is most of the time either totally absent or very hard to find. For license reasons, mostly or just because they simply don't give a shit.

Therefore, very early on I introduced a ZIP packaging in my build pipeline to generate the archives containing all the icons for a "1 click to download" experience, right from the homepage. When various colors variations were made after, they receive the same treatment, Finally, the icons were made available on this git repository.

So now, would it be feasible to go the extra miles, start from this raw auto-generated static website, turning it into a dynamic API, with color generation on the fly, user-accounts, setting up a CDN, rate-limiting… Sure it could be! I mean, I'm a web developer by trade so this the kind of things I do on my job all day long, no technical difficulty.

But the truth is, I feel this mutation into a "game-icons SaaS", would turn this barebone and fun project into one of its well-known concurrent monster. Losing the KISS aspect of the adventure would degrade my relationship to it because in my mind it would break the barrier with the big corporate projects that I build for customers during my real job. The risk to turn what it is a pleasure into a chore is tangible.

As you can see, right now, the last update is from December. Believe it or not, but I regularly receive angry emails from people "is the website DEAD???" "Hi I'm big investor who wants to put my crappy ads on your homepage". That's not the spirit! I usually answer to them : "com'on, relax ! there's no hurry. The website has been here for a decade, already offers 4000 thousands icons, I'm sure months long interruptions are not relevant in the great order of things, in this tormented world". But that's a reflect of our current over-consumption capitalistic era, where we want everything and as fast as possible, before jumping to the next thing.

As a conclusion, I don't mind if some people decide to scrap the site from time to times, or to hotlink a few images, as long as it does not trigger lasting slow consequence on the server. But if ever some abuses or misuses are harmful to the browsing comfort of other people, then we'll leave the territory of fairness and actions would have to be taken to limit the impact of such practices.

I hope this post gives you more insight about the overall idea surrounding this project.

aloisdg commented 3 years ago

Thank you for the complete input! As a fellow french who despite ads, patreon and capitalism what could I do to help a bit? I open issue from time to time to submit ideas but this is not much.

I could write a static api on top of a github repository (with github page). It would be crappy but free and low maintenance. It could help devs looking for a starting solution before hosting it themselves.

We could create it as project in this org. Something like https://game-icons.github.io/api/{name}.svg with support for png or whatever. This would be at least help against the hotlinking.

We can add a https://game-icons.github.io/api/all.json to have a list of all icons. A route to https://game-icons.github.io/api/tags.json to get all the tags and routes for each tags https://game-icons.github.io/api/{tag}.json

I am willing to build it and to run a script each week to generate each json.

source for github pages as api:

source for github actions as cron:

Such a base will fix: #653 and #429

aloisdg commented 3 years ago

Beside some websites have a cdn service with those icons:

note that I did not read their terms of use.

aloisdg commented 3 years ago

I saw that a CDN is on the roadmap:

image

michaeltlombardi commented 1 year ago

Any updates on the probability of a CDN? I can work around it for my users (working on a digital books toolkit for indie tabletop gaming authors), but using a CDN would be even better for me.

An API would be useful, but seems much higher effort to implement and maintain than hosting the icons on a CDN.