Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Edgar Gonzalez
    @edgar
    my concern with connecting pattrn to google sheets directly is that the internet speed in Venezuela is very bad
    I'd prefer to have the data "next" to the code. makes sense?
    hotzeplotz
    @hotzeplotz
    JSON Schemas - yes, that makes total sense: i thought about it during the v2 dev cycle but simply didn't have enough time to prioritise that. it would be interesting to hear about use cases (e.g. if people use data management tools that use JSON Schema directly) in order to target a first iteration of this feature towards real users
    yes, i do prefer to bundle data and code together too, also because of performance reasons and so that we don't have to depend on Google's TOS
    i asked about your workflow because if you do run data through your own build scripts it's much easier to handle things offline (i normally use a combination of R and Python) as compared to things that come "live" on the wire in formats on which we may have little control
    i can share the full build scripts for the demo instance linked above and you can hopefully use that as a starting point
    the example is quite specific to the shape and quirks of the raw data i had for that demo/workshop, but you should be able to see what's going on
    Edgar Gonzalez
    @edgar
    I'm more a Ruby guy but sure, thanks! if you can share with me the geojson format to support the media I can start working on that. I want to create a prototype first (with hardcoded/dummy data) to get journalist engaged
    hotzeplotz
    @hotzeplotz
    it's really very basic stuff, iterating through lists and producing JSON output, so any tooling will do really
    the GeoJSON for the demo instance is here, if you want to start having a look: https://busra.platform.pattrn.co/data/unesco-bosra/data.geojson
    Edgar Gonzalez
    @edgar
    thanks!
    hotzeplotz
    @hotzeplotz
    you will see that some of the features have a "photos" and/or "videos" arrays of objects within their GeoJSON properties, which is where the media metadata is read from. we didn't use links to web pages/articles and i can't remember if that sub-feature was updated from the Pattrn v1 codebase, but i'll have a look
    Edgar Gonzalez
    @edgar
    (sure that I'll bother you again)
    hotzeplotz
    @hotzeplotz
    @edgar i did some tests today and realised that the code for media items in Pattrn v2 is actually missing the code path that handles media items in GeoJSON datasets - it turns out i hadn't merged this from an earlier version, so i just did that. not pushed to GitHub yet as i haven't got time to double check everything, but i'll ping you once this is available
    in the meanwhile, you can add video and photo metadata as features of your GeoJSON dataset if you wish, sticking to a format similar to what you could see in the GeoJSON dataset of the demo instance i linked above yesterday (https://busra.platform.pattrn.co/data/unesco-bosra/data.geojson)
    and these features will be picked up by the updated Pattrn code (a small change to the metadata.yaml or metadata.json file for the instance is needed - i will add documentation for this)
    apologies, i meant properties, not features, of course
    basically a feature's property for photos will look like this:
    [
      {
        "source": "UNESCO",
        "src": "/data/unesco-bosra/media/photos/0010/0001.jpg",
        "subhtml": "Pas de dégâts apparents sur le cliché oblique diffusé par la nouvelle Direction des Antiquités de Bosra.",
        "thumb": "/data/unesco-bosra/media/photos/0010/0001.jpg",
        "caption": "Pas de dégâts apparents sur le cliché oblique diffusé par la nouvelle Direction des Antiquités de Bosra."
      }
    ]
    hotzeplotz
    @hotzeplotz
    it's an array so you can add as many as you need (within reason of course - if you have more than around 10 in my opinion the UX will not be very effective)
    similarly for the property for videos:
    [
      {
        "source": "UNESCO",
        "src": "https://www.youtube.com/watch?v=-Yyz4wKmcQY",
        "subhtml": "état des lieux en mars 2013.",
        "thumb": "https://i.ytimg.com/vi/-Yyz4wKmcQY/hqdefault.jpg",
        "caption": "état des lieux en mars 2013."
      }
    ]
    this is an array too, as above
    hotzeplotz
    @hotzeplotz
    for photos, you'll also want to package up the actual image files (and thumbnails if you use a different file for these) with your code/data bundle: the paths you see in the src and thumb properties of the object above are simply used as relative to the current site's root. you should be able to just use arbitrary HTTP/HTTPS URIS, depending on CORS and other policies, though i would generally recommend to package things up with your Pattrn instance if you can (licenses etc.) so that you can keep photos alongside the rest of your instance's content (and benefit from CDN etc if you publish your Pattrn app to Netlify or any other service that includes a CDN)
    hotzeplotz
    @hotzeplotz
    @edgar i have a personal branch with all the code needed for photos and videos integrated in Pattrn v2 (in-progress release v2.0.1) in my personal clone here: https://github.com/hotzeplotz/pattrn/tree/development/v2.0.1
    Edgar Gonzalez
    @edgar
    Thanks @hotzeplotz ! I'm currently traveling to SF, I'll try it and give you feedback. Thanks again
    hotzeplotz
    @hotzeplotz
    @edgar you are welcome. i will add proper documentation to docs.pattrn.co when i have a chance, but you'll likely find your way with the code in my branch above and the GeoJSON snippets earlier in this conversation, but give me a shout if you get stuck