Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

We need tool to convert de google sheet to YAML #88

Open
@jluis

Description

@jluis

To minimize the copy paste problems passing the talks data from the google doc I propose a script that parses a downloaded tsv and generates all the data from the google spreadsheet (we need to add one column for the icon and other for accepted talks:

#!/usr/bin/env perl

use strict;
use warnings;
use feature qw(say);

sub quote {
	local $_ = shift;
	s/"/\"/g;
	return '"'.$_.'"'
}

sub slug {
	local $_ = lc(shift);
	s/[^a-z ]//g;
	s/ +$//;
	s/ /-/gr;
}

while (<>) {
       my @values = split /\t/;
       next unless $values[0] =~  m|[123]?\d/[1]?\d/\d{4} [12]?\d(?:\:\d{2}){2}|;
       say " - author: ".quote $values[2];
       say "   name: ".quote $values[3];
       say "   slug: ".quote slug $values[3];
       say "   description: ".quote $values[4];
       say "   icon: ".($values[8]? quote($values[8]):"'fa-WTF'");
       say "   duration: ". $values[5];
       say "   accepted: ". (defined($values[7]) ? 'false':'true');
       say "   language: ".(defined($values[6]) ? quote($values[6]):"'unknown'");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions