Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rewrite NodeJS app #66

Merged
merged 6 commits into from
Jun 14, 2016
Merged

Conversation

dadoonet
Copy link
Member

It helps to rewrite/reformat and make consistent the baggers.js file.

node rewrite/rewrite.js
rewrite/rewrite.js

It will generate a file named rewrite/baggers-new.js which is git ignored.

The script:

  • rename baggers by speakers
  • moves tags under each talk, which means that every speaker will have then to modify its talks if tags are incorrects
  • normalized the name by uppercasing each first letter and lowercasing the other letters.
  • normalized website titles. We check for LinkedIn, GitHub, Podcast, Google+, Slideshare, Hopwork, Book, InfoQ and Viadeo. Other titles are set to Web
  • contact is now an object which contains two fields:
    • type: facultative. No data mean mail. If no contact was provided, it fallbacks to twitter.
    • url: the email address is provided, the twitter handle otherwise

For example, Gregory Estrade will be modified from:

{
    "since": "2015-09-24",
    "name": "Gregory Estrade",
    "bio": "Directeur R&D de Lyra-Network, software & hardware hacker, reverse-engineer, philosophe agile auto-proclamé. Ou Disruptive Innovation Lead Strategist, Instant Expert in Everything, ça dépend. Membre de l'association Silicium de préservation du patrimoine micro-informatique.",
    "picture": "http://torlus.github.io/hat_pro.png",
    "websites": [
        {
            "title": "Home Page",
            "href": "http://lvt.tl/"
        },
        {
            "title": "GitHub",
            "href": "https://github.com/Torlus"
        },
        {
            "title": "Silicium",
            "href": "http://www.silicium.org/"
        }
    ],
    "twitter": "Torlus",
    "contact": "gregory.estrade@gmail.com",
    "mail": "gregory.estrade@gmail.com",
    "location": "Toulouse",
    "sessions": [
        {
            "title": "Les nouveaux enjeux du paiement.",
            "summary": "Etat de l'art, sécurité, les moyens de paiement et leur avenir, les enjeux du click-and-mortar, SEPA, marketplaces."
        },
        {
            "title": "IoT, software & hardware hacking, FPGA.",
            "summary": "Vous aimez bricoler, prototyper? Moi aussi. Invitez-moi pour de l'aide ou du conseil sur un sujet de votre choix."
        },
        {
            "title": "Café philosophique, agilité, histoire de l'informatique.",
            "summary": "Ayant eu depuis 30 ans les mains sur un clavier (En commençant sur un TRS-80) et étant membre de l'association Silicium, je vous propose de deviser autour de tout ce qui fait l'actualité, et qui tend à montrer que quoi qu'on fasse, l'histoire vient souvent à se répéter."
        }
    ],
    "tags": [
        "Software development",
        "Hardware hacking",
        "Optimisation",
        "Telecom & Réseau",
        "FPGA",
        "Philosophie",
        "Agilité"
    ],
    "cities": [
        "Toulouse"
    ]
}

to:

{
  "since": "2015-09-24",
  "name": "Gregory Estrade",
  "bio": "Directeur R&D de Lyra-Network, software & hardware hacker, reverse-engineer, philosophe agile auto-proclamé. Ou Disruptive Innovation Lead Strategist, Instant Expert in Everything, ça dépend. Membre de l'association Silicium de préservation du patrimoine micro-informatique.",
  "picture": "http://torlus.github.io/hat_pro.png",
  "websites": [
    {
      "name": "Web",
      "url": "http://lvt.tl/"
    },
    {
      "name": "GitHub",
      "url": "https://github.com/Torlus"
    },
    {
      "name": "Web",
      "url": "http://www.silicium.org/"
    }
  ],
  "twitter": "Torlus",
  "location": "Toulouse",
  "sessions": [
    {
      "title": "Les nouveaux enjeux du paiement.",
      "abstract": "Etat de l'art, sécurité, les moyens de paiement et leur avenir, les enjeux du click-and-mortar, SEPA, marketplaces.",
      "tags": [
        "Software development",
        "Hardware hacking",
        "Optimisation",
        "Telecom & Réseau",
        "FPGA",
        "Philosophie",
        "Agilité"
      ]
    },
    {
      "title": "IoT, software & hardware hacking, FPGA.",
      "abstract": "Vous aimez bricoler, prototyper? Moi aussi. Invitez-moi pour de l'aide ou du conseil sur un sujet de votre choix.",
      "tags": [
        "Software development",
        "Hardware hacking",
        "Optimisation",
        "Telecom & Réseau",
        "FPGA",
        "Philosophie",
        "Agilité"
      ]
    },
    {
      "title": "Café philosophique, agilité, histoire de l'informatique.",
      "abstract": "Ayant eu depuis 30 ans les mains sur un clavier (En commençant sur un TRS-80) et étant membre de l'association Silicium, je vous propose de deviser autour de tout ce qui fait l'actualité, et qui tend à montrer que quoi qu'on fasse, l'histoire vient souvent à se répéter.",
      "tags": [
        "Software development",
        "Hardware hacking",
        "Optimisation",
        "Telecom & Réseau",
        "FPGA",
        "Philosophie",
        "Agilité"
      ]
    }
  ],
  "cities": [
    "Toulouse"
  ],
  "contact": {
    "url": "gregory.estrade@gmail.com"
  }
}

Optimizations

The script also reorders:

  • speakers by since date, older's first
  • cities by name

Related to #65.

@dadoonet dadoonet self-assigned this Jan 18, 2016
@dadoonet
Copy link
Member Author

If someone wants to look at this... My plan is:

  1. modify and create a PR for the brownbaglunch.fr website which takes into account this new format
  2. update https://github.com/brownbaglunch/webhook project to reflect those changes
  3. finish the website rewriting. I have a new version running locally but there are still some work to do. For now, it allows searching in any field for a speaker...

It's a start but in a good shape...

localhost 9000- -search google chrome jeudi 14 janvier 2016 at 10 40 41

Let me know what you think about the plan and the PR :)

cc @fsarradin @ycombinator

@fsarradin
Copy link
Member

I didn't see the contact section like that ':D
So why not doing something like that?

"contact": {
    "mail": "my-email@dr.ess",
    "twitter": "@twitteraccount",
    "whatever": "..."
}

This may help to remove the twitter field above.

On the other hand, if you need a UI designer, I can find someone for that ^^

@dadoonet
Copy link
Member Author

@fsarradin It makes sense but still how do we choose how we contact a speaker? First, try mail, then twitter?
It works for me but I just want to double check.

On the other hand, if you need a UI designer, I can find someone for that ^^

Sure. Let me finish the infra and then we can open an issue to enhance all that.

I suggest to open a new branch in https://github.com/brownbaglunch/BrownBagLunch which will allow us to contribute the code from different authors...
And then when ready just merge the branch in gh-pages.

@fsarradin
Copy link
Member

@dadoonet

It makes sense but still how do we choose how we contact a speaker? First, try mail, then twitter?
It works for me but I just want to double check.

It's ok for me.

@dadoonet dadoonet changed the title Pr/rewrite baggers Add rewrite NodeJS app Jan 19, 2016
@dadoonet
Copy link
Member Author

@fsarradin Added a new commit. It's fine now.

I think I'll add also a lang field for each talk like:

"lang": [ "fr" ]
"lang": [ "fr", "en" ]

So baggers would be able to define either:

One talk per language (abstract in french and in english) or one single abstract but the talk would be available in french and english (obviously the abstract would probably be better written in english ;) ).

@fsarradin
Copy link
Member

👍

@dadoonet
Copy link
Member Author

I think I'm almost done with this PR.

Here is what have now:

From

        {
            "since": "2013-06-03",
            "name": "Antonio Goncalves",
            "bio": "Java EE et que Java EE - Freelance - Co-créateur de @ParisJUG @DevoxxFR",
            "picture": "http://agoncal.files.wordpress.com/2013/05/antonio2013square2562.jpg",
            "websites": [
                {
                    "title": "Blog personnel",
                    "href": "http://antoniogoncalves.org/"
                },
                {
                    "title": "Les bouquins que j'ai écrit",
                    "href": "http://antoniogoncalves.org/category/books/"
                }
            ],
            "twitter": "agoncal",
            "contact": "prenom.nom@gmail.com",
            "mail": "antonio.goncalves@gmail.com",
            "location": "Paris intramuros... mais je veux bien faire un effort",
            "sessions": [
                {
                    "title": "Nouveautés Java EE",
                    "summary": "Slides, code et discussion autour des nouveautés Java EE 7 et Java EE 6."
                },
                {
                    "title": "Migrer vos vielles applications",
                    "summary": "Vous faites du J2EE 1.4 ou du Spring et vous voulez migrer tout ou partie de vos applications, discutons-en."
                },
                {
                    "title": "CDI",
                    "summary": "Découvrez comment faire de l'injection, de l'interception, de la décoration ou de l'évenementiel avec Java EE"
                },
                {
                    "title": "Arquillian",
                    "summary": "Vous connaissez les tests unitaires et les Mocks, découvrez Arquillian pour les tests d'intégration in-container."
                },
                {
                    "title": "Une application Java EE 6 en moins d’une heure",
                    "summary": "Live coding d'une application web avec JBoss Forge, Aquillian, DeltaSpike et déployée dans JBoss, GlassFish et TomEE."
                }
            ],
            "tags": [
                "JavaEE",
                "J2EE",
                "CDI",
                "Arquillian"
            ],
            "cities": [
                "Paris"
            ]
        }
    {
      "since": "2013-06-03",
      "name": "Antonio Goncalves",
      "bio": "Java EE et que Java EE - Freelance - Co-créateur de @ParisJUG @DevoxxFR",
      "picture": "http://agoncal.files.wordpress.com/2013/05/antonio2013square2562.jpg",
      "websites": [
        {
          "name": "Web",
          "url": "http://antoniogoncalves.org/"
        },
        {
          "name": "Book",
          "url": "http://antoniogoncalves.org/category/books/"
        }
      ],
      "location": "Paris intramuros... mais je veux bien faire un effort",
      "sessions": [
        {
          "title": "Nouveautés Java EE",
          "abstract": "Slides, code et discussion autour des nouveautés Java EE 7 et Java EE 6.",
          "tags": [
            "JavaEE",
            "J2EE",
            "CDI",
            "Arquillian"
          ],
          "lang": [
            "fr"
          ]
        },
        {
          "title": "Migrer vos vielles applications",
          "abstract": "Vous faites du J2EE 1.4 ou du Spring et vous voulez migrer tout ou partie de vos applications, discutons-en.",
          "tags": [
            "JavaEE",
            "J2EE",
            "CDI",
            "Arquillian"
          ],
          "lang": [
            "fr"
          ]
        },
        {
          "title": "CDI",
          "abstract": "Découvrez comment faire de l'injection, de l'interception, de la décoration ou de l'évenementiel avec Java EE",
          "tags": [
            "JavaEE",
            "J2EE",
            "CDI",
            "Arquillian"
          ],
          "lang": [
            "fr"
          ]
        },
        {
          "title": "Arquillian",
          "abstract": "Vous connaissez les tests unitaires et les Mocks, découvrez Arquillian pour les tests d'intégration in-container.",
          "tags": [
            "JavaEE",
            "J2EE",
            "CDI",
            "Arquillian"
          ],
          "lang": [
            "fr"
          ]
        },
        {
          "title": "Une application Java EE 6 en moins d’une heure",
          "abstract": "Live coding d'une application web avec JBoss Forge, Aquillian, DeltaSpike et déployée dans JBoss, GlassFish et TomEE.",
          "tags": [
            "JavaEE",
            "J2EE",
            "CDI",
            "Arquillian"
          ],
          "lang": [
            "fr"
          ]
        }
      ],
      "cities": [
        "Paris"
      ],
      "contact": {
        "twitter": "agoncal",
        "mail": "antonio.goncalves@gmail.com"
      }
    }

I'm still wondering though if it makes sense to keep cities and location.

I'd like to replace cities with something like:

"cities": [
   {"city":"Paris", "range": "30km"}, 
   {"city":"Nantes", "range": "100km"} 
]

Or something similar.

Why this? Because at index time, the city is enriched with real geo coordinates. It would then be easy to propose talks to companies based on their address (geo_loc).

So if my company is based in La Défense (48.892722, 2.239473), I can easily find speakers who agree on speaking nearby.

WDYT?

I'll probably initialize the data with a range of 20km for example. People would be able to adapt it later.

@fsarradin
Copy link
Member

Cities: I tend to agree. But I wouldn't be the only one to decide.

@dadoonet
Copy link
Member Author

Hey! You are not alone! I'm here as well :)

Let's wait for tomorrow and I'll add it to the PR unless someone objects in the meantime.

@nrichand
Copy link
Member

@dadoonet I like the idea, it will allow to create new cool services in the future, like "display only baggers near me".

@dadoonet
Copy link
Member Author

Hehe. You read my mind :)

dadoonet added a commit to dadoonet/BrownBagLunch that referenced this pull request Jan 21, 2016
In brownbaglunch/bblfr_data#66 we meant to change the model.

This PR (WIP) takes care of the change.

It will help to make progress in baby steps:

* update the model: brownbaglunch/bblfr_data#66
* update the website to the new model: this PR
* rewrite the website using elasticsearch as the search backend

Note that to test it, you need to generate `../bblfr_data/rewrite/baggers-new.js`.
Then uncomment the `local` part and comment the `remote` part.
It helps to rewrite/reformat and make consistent the `baggers.js` file.

```sh
node rewrite/rewrite.js
rewrite/rewrite.js
```

It will generate a file named `rewrite/baggers-new.js` which is git ignored.

The script:

* moves `tags` under each talk, which means that every speaker will have then to modify its talks if tags are incorrects
* normalized the `name` by uppercasing each first letter and lowercasing the other letters.
* normalized website titles. We check for `LinkedIn`, `GitHub`, `Podcast`, `Google+`, `Slideshare`, `Hopwork`, `Book`, `InfoQ` and `Viadeo`. Other titles are set to `Web`
* contact is now an object which contains two fields:
    * `type`: facultative. No data mean `mail`. If no contact was provided, it fallbacks to `twitter`.
    * `url`: the email address is provided, the twitter handle otherwise

For example, `Gregory Estrade` will be modified from:

```json
{
    "since": "2015-09-24",
    "name": "Gregory Estrade",
    "bio": "Directeur R&D de Lyra-Network, software & hardware hacker, reverse-engineer, philosophe agile auto-proclamé. Ou Disruptive Innovation Lead Strategist, Instant Expert in Everything, ça dépend. Membre de l'association Silicium de préservation du patrimoine micro-informatique.",
    "picture": "http://torlus.github.io/hat_pro.png",
    "websites": [
        {
            "title": "Home Page",
            "href": "http://lvt.tl/"
        },
        {
            "title": "GitHub",
            "href": "https://github.com/Torlus"
        },
        {
            "title": "Silicium",
            "href": "http://www.silicium.org/"
        }
    ],
    "twitter": "Torlus",
    "contact": "gregory.estrade@gmail.com",
    "mail": "gregory.estrade@gmail.com",
    "location": "Toulouse",
    "sessions": [
        {
            "title": "Les nouveaux enjeux du paiement.",
            "summary": "Etat de l'art, sécurité, les moyens de paiement et leur avenir, les enjeux du click-and-mortar, SEPA, marketplaces."
        },
        {
            "title": "IoT, software & hardware hacking, FPGA.",
            "summary": "Vous aimez bricoler, prototyper? Moi aussi. Invitez-moi pour de l'aide ou du conseil sur un sujet de votre choix."
        },
        {
            "title": "Café philosophique, agilité, histoire de l'informatique.",
            "summary": "Ayant eu depuis 30 ans les mains sur un clavier (En commençant sur un TRS-80) et étant membre de l'association Silicium, je vous propose de deviser autour de tout ce qui fait l'actualité, et qui tend à montrer que quoi qu'on fasse, l'histoire vient souvent à se répéter."
        }
    ],
    "tags": [
        "Software development",
        "Hardware hacking",
        "Optimisation",
        "Telecom & Réseau",
        "FPGA",
        "Philosophie",
        "Agilité"
    ],
    "cities": [
        "Toulouse"
    ]
}
```

to:

```json
{
  "since": "2015-09-24",
  "name": "Gregory Estrade",
  "bio": "Directeur R&D de Lyra-Network, software & hardware hacker, reverse-engineer, philosophe agile auto-proclamé. Ou Disruptive Innovation Lead Strategist, Instant Expert in Everything, ça dépend. Membre de l'association Silicium de préservation du patrimoine micro-informatique.",
  "picture": "http://torlus.github.io/hat_pro.png",
  "websites": [
    {
      "name": "Web",
      "url": "http://lvt.tl/"
    },
    {
      "name": "GitHub",
      "url": "https://github.com/Torlus"
    },
    {
      "name": "Web",
      "url": "http://www.silicium.org/"
    }
  ],
  "twitter": "Torlus",
  "location": "Toulouse",
  "sessions": [
    {
      "title": "Les nouveaux enjeux du paiement.",
      "abstract": "Etat de l'art, sécurité, les moyens de paiement et leur avenir, les enjeux du click-and-mortar, SEPA, marketplaces.",
      "tags": [
        "Software development",
        "Hardware hacking",
        "Optimisation",
        "Telecom & Réseau",
        "FPGA",
        "Philosophie",
        "Agilité"
      ]
    },
    {
      "title": "IoT, software & hardware hacking, FPGA.",
      "abstract": "Vous aimez bricoler, prototyper? Moi aussi. Invitez-moi pour de l'aide ou du conseil sur un sujet de votre choix.",
      "tags": [
        "Software development",
        "Hardware hacking",
        "Optimisation",
        "Telecom & Réseau",
        "FPGA",
        "Philosophie",
        "Agilité"
      ]
    },
    {
      "title": "Café philosophique, agilité, histoire de l'informatique.",
      "abstract": "Ayant eu depuis 30 ans les mains sur un clavier (En commençant sur un TRS-80) et étant membre de l'association Silicium, je vous propose de deviser autour de tout ce qui fait l'actualité, et qui tend à montrer que quoi qu'on fasse, l'histoire vient souvent à se répéter.",
      "tags": [
        "Software development",
        "Hardware hacking",
        "Optimisation",
        "Telecom & Réseau",
        "FPGA",
        "Philosophie",
        "Agilité"
      ]
    }
  ],
  "cities": [
    "Toulouse"
  ],
  "contact": {
    "url": "gregory.estrade@gmail.com"
  }
}
```

Related to brownbaglunch#65.
Will be easier then to add new people at the end of the list.

Related to brownbaglunch#65.
Might be easier then to add new cities.

Related to brownbaglunch#65.
After review, we finally voted to have `contact` field as:

```js
"contact": {
    "mail": "my-email@dr.ess",
    "twitter": "@twitteraccount",
    "whatever": "..."
}
```
@dadoonet dadoonet merged commit e50f24b into brownbaglunch:gh-pages Jun 14, 2016
@dadoonet dadoonet deleted the pr/rewrite-baggers branch June 14, 2016 09:32
dadoonet added a commit to dadoonet/BrownBagLunch that referenced this pull request Jun 15, 2016
In brownbaglunch/bblfr_data#66 we meant to change the model.

This PR (WIP) takes care of the change.

It will help to make progress in baby steps:

* update the model: brownbaglunch/bblfr_data#66
* update the website to the new model: this PR
* rewrite the website using elasticsearch as the search backend

Note that to test it, you need to generate `../bblfr_data/rewrite/baggers-new.js`.
Then uncomment the `local` part and comment the `remote` part.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants