IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Creating One Unified Calendar of all Data Science Events in the Netherlands

    Roel M. Hogervorst发表于 2022-12-02 00:00:00
    love 0
    [This article was first published on Category R on Roel's R-tefacts, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
    Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

    I enjoy learning new things about machine learning, and I enjoy meeting like minded people too. That is why I go to meetups and conferences. But not everyone I meet becomes a member of every group. So I keep sending my coworkers new events that I hear about here in the Netherlands. And it is easy to overlook a new event that comes in over email. Me individually cannot scale. So in this post I will walk you through an over engineered solution to make myself unnecessary.

    I found out that meetup.com creates an ical and rss feed for every meetup. I love it when companies adhere to open standards!

    So could we combine the calendar feeds of all the groups into one big calendar for the Netherlands?

    Inspired by Simon Willison I knew I could use github actions to run a periodic scrape through all calendars.

    So here is my idea:

    • make a simple script that takes in all the calendar feeds (ical) of local groups
    • combine those events into 1 ical feed
    • commit that file to the public repository
    • Add that url that points to github to our to our internal company website so that all the events are visible
    • Run the system everyday automatically
    • make it easy to add or remove organizers (meetups) with a simple config file

    So here is the end result DS calendar.

    calendar view

    I could have easily done this project in python, but for this example I chose R, because I love that language.

    Deeper dive

    So here is the entire github actions configuration:

    name: Scrape latest events of Dutch Data Science events
    
    on:
     push:
     paths:
     - 'calendars.csv'
     workflow_dispatch:
     schedule:
     - cron: '12 12 * * *'
    
    jobs:
     scheduled:
     runs-on: ubuntu-latest
     steps:
     - name: Check out this repo
     uses: actions/checkout@v2
     - uses: r-lib/actions/setup-r@v2
     with:
     use-public-rspm: true
     - uses: r-lib/actions/setup-renv@v2
     - name: run scrape
     run: Rscript aggregate.R
     - name: Commit and push if it changed
     run: |-
     git config user.name "Automated"
     git config user.email "actions@users.noreply.github.com"
     git add -A
     timestamp=$(date -u)
     git commit -m "Latest data: ${timestamp}" || exit 0
     git push
    
    

    First the top of the file

    on: # what makes it trigger ?
     # - on push events
     push:
     paths: # but only where specifically this file changed
     - 'calendars.csv'
     workflow_dispatch:
     # - on a schedule
     schedule:
     - cron: '12 12 * * *'
    

    Then the steps

    • Check out this repo
    • set up R to use on this ubuntu machine (with the fast precompiled packages )
    • setup renv (to set specific packages)
    • run the Rscript aggregate.R
    • Commit and push if it changed

    A pocketwatch

    Concluding

    So with this example you could create your own selection of calendars and combine them together into one feed for your group.

    with this example in hand you could create your python version too. here is a python package to parse ical files

    References

    • Find more walkthroughs by me in this tutorial overview page

    • glass ball source

    To leave a comment for the author, please follow the link and comment on their blog: Category R on Roel's R-tefacts.

    R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
    Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
    Continue reading: Creating One Unified Calendar of all Data Science Events in the Netherlands


沪ICP备19023445号-2号
友情链接