Skip to content

Instantly share code, notes, and snippets.

@swinton
Created October 29, 2014 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swinton/717d7448d1903f351e74 to your computer and use it in GitHub Desktop.
Save swinton/717d7448d1903f351e74 to your computer and use it in GitHub Desktop.
Google Refine history log that transposes a tweets.csv archive into a CSV that can be imported into Google Calendar.
[
{
"op": "core/column-addition",
"description": "Create column Start Date at index 4 based on column timestamp using expression grel:value",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Start Date",
"columnInsertIndex": 4,
"baseColumnName": "timestamp",
"expression": "grel:value",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column End Date at index 5 based on column Start Date using expression grel:value",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "End Date",
"columnInsertIndex": 5,
"baseColumnName": "Start Date",
"expression": "grel:value",
"onError": "set-to-blank"
},
{
"op": "core/column-removal",
"description": "Remove column timestamp",
"columnName": "timestamp"
},
{
"op": "core/column-removal",
"description": "Remove column in_reply_to_status_id",
"columnName": "in_reply_to_status_id"
},
{
"op": "core/column-removal",
"description": "Remove column in_reply_to_user_id",
"columnName": "in_reply_to_user_id"
},
{
"op": "core/column-removal",
"description": "Remove column source",
"columnName": "source"
},
{
"op": "core/column-rename",
"description": "Rename column tweet_id to Subject",
"oldColumnName": "tweet_id",
"newColumnName": "Subject"
},
{
"op": "core/column-addition",
"description": "Create column Description at index 4 based on column text using expression grel:value + \"\\n\\n--\\nhttps://twitter.com/steveWINton/status/\" + cells[\"Subject\"].value",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Description",
"columnInsertIndex": 4,
"baseColumnName": "text",
"expression": "grel:value + \"\\n\\n--\\nhttps://twitter.com/steveWINton/status/\" + cells[\"Subject\"].value",
"onError": "set-to-blank"
},
{
"op": "core/column-removal",
"description": "Remove column text",
"columnName": "text"
},
{
"op": "core/column-removal",
"description": "Remove column retweeted_status_id",
"columnName": "retweeted_status_id"
},
{
"op": "core/column-removal",
"description": "Remove column retweeted_status_user_id",
"columnName": "retweeted_status_user_id"
},
{
"op": "core/column-removal",
"description": "Remove column expanded_urls",
"columnName": "expanded_urls"
},
{
"op": "core/column-removal",
"description": "Remove column retweeted_status_timestamp",
"columnName": "retweeted_status_timestamp"
},
{
"op": "core/column-addition",
"description": "Create column All Day Event at index 4 based on column Description using expression grel:\"FALSE\"",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "All Day Event",
"columnInsertIndex": 4,
"baseColumnName": "Description",
"expression": "grel:\"FALSE\"",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column Location at index 5 based on column All Day Event using expression grel:\"\"",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Location",
"columnInsertIndex": 5,
"baseColumnName": "All Day Event",
"expression": "grel:\"\"",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column Private at index 5 based on column All Day Event using expression grel:\"TRUE\"",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Private",
"columnInsertIndex": 5,
"baseColumnName": "All Day Event",
"expression": "grel:\"TRUE\"",
"onError": "set-to-blank"
},
{
"op": "core/column-move",
"description": "Move column Description to position 4",
"columnName": "Description",
"index": 4
},
{
"op": "core/column-move",
"description": "Move column Private to position 6",
"columnName": "Private",
"index": 6
},
{
"op": "core/column-addition",
"description": "Create column Start Date (2) at index 2 based on column Start Date using expression grel:value.substring(8,10)+\"/\"+value.substring(5,7)+\"/\"+value.substring(0, 4)",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Start Date (2)",
"columnInsertIndex": 2,
"baseColumnName": "Start Date",
"expression": "grel:value.substring(8,10)+\"/\"+value.substring(5,7)+\"/\"+value.substring(0, 4)",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column End Date (2) at index 4 based on column End Date using expression grel:value.substring(8,10)+\"/\"+value.substring(5,7)+\"/\"+value.substring(0, 4)",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "End Date (2)",
"columnInsertIndex": 4,
"baseColumnName": "End Date",
"expression": "grel:value.substring(8,10)+\"/\"+value.substring(5,7)+\"/\"+value.substring(0, 4)",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column Start Time at index 2 based on column Start Date using expression grel:value.substring(11,19)",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Start Time",
"columnInsertIndex": 2,
"baseColumnName": "Start Date",
"expression": "grel:value.substring(11,19)",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column End Time at index 5 based on column End Date using expression grel:value.substring(11,19)",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "End Time",
"columnInsertIndex": 5,
"baseColumnName": "End Date",
"expression": "grel:value.substring(11,19)",
"onError": "set-to-blank"
},
{
"op": "core/column-move",
"description": "Move column Start Date (2) to position 2",
"columnName": "Start Date (2)",
"index": 2
},
{
"op": "core/column-removal",
"description": "Remove column Start Date",
"columnName": "Start Date"
},
{
"op": "core/column-rename",
"description": "Rename column Start Date (2) to Start Date",
"oldColumnName": "Start Date (2)",
"newColumnName": "Start Date"
},
{
"op": "core/column-move",
"description": "Move column End Date (2) to position 4",
"columnName": "End Date (2)",
"index": 4
},
{
"op": "core/column-removal",
"description": "Remove column End Date",
"columnName": "End Date"
},
{
"op": "core/column-rename",
"description": "Rename column End Date (2) to End Date",
"oldColumnName": "End Date (2)",
"newColumnName": "End Date"
},
{
"op": "core/column-removal",
"description": "Remove column Location",
"columnName": "Location"
},
{
"op": "core/column-addition",
"description": "Create column Location at index 1 based on column Subject using expression grel:\"https://twitter.com/steveWINton/status/\"+value",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Location",
"columnInsertIndex": 1,
"baseColumnName": "Subject",
"expression": "grel:\"https://twitter.com/steveWINton/status/\"+value",
"onError": "set-to-blank"
},
{
"op": "core/column-move",
"description": "Move column Location to position 8",
"columnName": "Location",
"index": 8
},
{
"op": "core/column-removal",
"description": "Remove column Subject",
"columnName": "Subject"
},
{
"op": "core/column-addition",
"description": "Create column Subject at index 6 based on column Description using expression grel:value.substring(0, 80) + \"...\"",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Subject",
"columnInsertIndex": 6,
"baseColumnName": "Description",
"expression": "grel:value.substring(0, 80) + \"...\"",
"onError": "set-to-blank"
},
{
"op": "core/column-move",
"description": "Move column Subject to position 0",
"columnName": "Subject",
"index": 0
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment