Giter VIP home page Giter VIP logo

Comments (1)

danreedy avatar danreedy commented on July 20, 2024

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.
screen shot 2013-05-06 at 1 44 10 pm.

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.