Url2wikitext

From SOBAC Wiki
Jump to navigation Jump to search

This script converts Meetup.com URLs to Wikitext suitable for the WatCamp page.


#! /usr/bin/gawk

# Program:  meetupurl2wikitext.awk
# Purpose:  Convert raw URLs from Meetup.com to Wikitext with iCal links
#             suitable for use on https://sobac.com/wiki/WatCamp#Monitored_by_Bob_Jonkman
# Author:   Bob Jonkman
# Date:     6 October 2017

# Input format: https://www.meetup.com/Lean-Product-Waterloo
# Note: No trailing slash

BEGIN {
  FS="/" ;
}

    {
      name=$NF;
      gsub(/-/," ",name);
      print "# [" $0 "/ " name "] {{ical|url=" $0 "/events/ical/}}";
}

# EOF: meetupurl2wikitext.awk