Comments (6)
Sure thing! Let us know if you have any other questions. Limiting the use of the API is not only a benefit for you and your users, but for us as well. Running servers on ad-only income is a tough balancing act. 😄
from pictogrammers.com.
Closing as I found the documentation under contributing:
https://pictogrammers.com/docs/contribute/api/
from pictogrammers.com.
You shouldn't be using the API for this use case.
There are two ways you could do this:
-
Install
@mdi/svg
and reference themeta.json
file for each icon's metadata. Read thesvg/{ICON_NAME}.svg
to get the SVG and extract thed
attribute from thepath
. -
Install
@mdi/js
. You can directly get the path data this way.import { mdiAccount } from '@mdi/js'; console.log(mdiAccount); // M12,...14Z
from pictogrammers.com.
Thanks for the reply @mririgoyen , I'm not sure if I'm missing something but I don't see how that fits into a java based library for android?
The idea of the lib is to load icons as needed based on the name of the icon, this can come from an api or be set in code, and then store the icon locally, is that the same thing you had in mind?
from pictogrammers.com.
Yes, that would be ideal for a number of reasons. You would bring all assets down locally, avoiding network requests. This will be much quicker for your users and prevent unneeded network traffic to the site. You also avoid things breaking if the site goes down for some reason.
Please note that the article you found on our API documentation explicitly states:
Please do not use these endpoints to scrape the site or to build third party applications. All data is provided in the meta.json on the CDN or in the GitHub repo after every release.
So, in your case, the two options available to you would be:
-
Use
@mdi/svg
, either from NPM or from cloning the GitHub repo. Read themeta.json
file and then thesvg/{ICON_NAME.svg}
files to get the information you need. -
Continue using the CDN to get the
meta.json
file, but instead of using the API to get the icon, just use the CDN again.https://cdn.jsdelivr.net/npm/@mdi/[email protected]/svg/account.svg
The first option bring all icons local and removes the need for network requests, which would be the ideal path IMO. The second option slightly alters what you are currently doing to avoid using the API.
from pictogrammers.com.
Ah, I see, ok cool, I must have missed that api note on the old documentation. Thanks, let me make some updates.
from pictogrammers.com.
Related Issues (20)
- Why are so many icons being deprecated? HOT 1
- Vip Tips HOT 1
- Search with Cyrillic letters brokes site. HOT 1
- Page crashes when type "!" in search HOT 1
- Rails getting started page uses inexisting gem HOT 3
- The page content can't display normally HOT 1
- When will you be changing old twitter icon to X? HOT 1
- URL for all icons in a certain release
- Support Material Symbols HOT 1
- Generator combining existing icons HOT 1
- MDI icon library page failing to load HOT 5
- Include X icon (to change the old Twitter icon) HOT 1
- New Feature
- Hot water tank HOT 1
- Add Rightwards Arrow Over Leftwards Arrow
- shutter-blades-open HOT 1
- Account HOT 1
- add social media icons HOT 1
- Draw.io support
- Suggested Change to "Pixel Editor"
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 pictogrammers.com.