Comments (1)
I worked up a quick proof-of-concept for parsing submissions and providing a JSON output. You can see review the commit. I'm not comfortable enough with it to submit a pull request, but thought it might be a step towards a universally available JSON listing of submissions. This was a quick lunch-break hack and my PHP is rusty.
In short, the newly added includes/json_parser.php
script rolls through the submissions directories, reads the first line of the CSS file, and attempts to parse the submission details. Currently it is only mimicking masterlist.php but could be extended to provide the path for the CSS file or a link to view it on csszengardne.com.
The parsing is fragile due to inconsistencies within that first line of the CSS. In fact, parsing this information is extremely inelegant at the moment, relying on several preg_match
calls.
The result, once you visit the site, is you'll be served a JSON file that looks something like this.
.
Other thoughts
In order for this to be effective, the CSS files should be uniform in presenting the submission number, name, author, and website. It might be easier to add a .json
file in each folder that contains that information, which would eliminate the need for parsing the CSS at all.
I left the PHP script I wrote in the includes
directory, though it would make sense to move that to the top-level, for public consumption.
from csszengarden.com.
Related Issues (20)
- Navigating design archive pages seems weird HOT 1
- Create a NodeJS version HOT 3
- Support csszengarden.com over https
- Broken Links HOT 2
- 2021 Update? HOT 6
- The example HTML file is empty HOT 1
- Nicer URLs with mod_rewrite HOT 4
- Canvas element? HOT 1
- Sample HTML file - less static HOT 1
- extra divs - replace
- Bring back legacy HTML/designs HOT 1
- Responsive #001 HOT 2
- OOCSS / SMACSS classes HOT 2
- 214: Bugs HOT 3
- Empty Anchor Links HOT 2
- XSS vulnerability HOT 1
- mod_rewrite funkiness HOT 5
- site is not correctly updated HOT 1
- Garden Party's layout is broken at the bottom
- LICENSE?
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 csszengarden.com.