Tag Archives: capebreton

On Davis Day, and other histories of Cape Breton

Today is Davis Day in Cape Breton. It’s now known as Miners Memorial Day, but growing up we honoured this day and thought about William Davis and all the sacrifices miners and their families suffered over the years as they struggled to live better lives. It was a solemn day. You can read more about it here: Miners Memorial Day: Davis Day | Museum of Industry. Here’s a good piece on how this day is still relevant in places like my home town of Glace Bay.

Over the last while I have been collecting these links regarding Cape Breton history which I thought worthwhile and you may as well:

(Image from a link and comes from the Beaton Institute)

What I learned writing web scrapers last week


I started writing web scrapers last week. If you don’t know, web scraper code can read web pages on the Internet and pull information from them.

I have to thank the Ontario Minister of Health for prompting me to do this. The Minister used to share COVID-19 information on twitter, but then chose recently to no longer do that. You can come to your own conclusions as to why she stopped. As for me, I was irritated by the move. Enough so that I decided to get the information and publish it myself.

Fortunately I had two things to start with. One, this great book: Automate the Boring Stuff with Python. There is a chapter in there on how to scrape web pages using Python and something called Beautiful Soup. Two, I had the minister’s own web site: https://covid-19.ontario.ca/. It had the data I wanted right there! I wrote a little program called covid.py to scrape the data from the page and put it all on one line of output which I share on twitter every day.

Emboldened by my success, I decided to write more code like this. The challenge is finding a web page where the data is clearly marked by some standard HTML. For example, the COVID data I wanted is associated with paragraph HTML tag and it has a class label of  covid-data-block__title and covid-data-block__data. Easy.

My next bit of code was obit.py: this program scrapes the SaltWire web site (Cape Breton Post) for obituaries listed there, and writes it out into HTML. Hey, it’s weird, but again the web pages are easy to scrape. And  it’s an easy way to read my hometown’s obits to see if any of my family or friends have died. Like the Covid data, the obit’s were associated with some html, this time it was a div statement of class sw-obit-list__item. Bingo, I had my ID to get the data.

My last bit of code was somewhat different. The web page I was scraping was on the web but instead of HTML it was a CSV file. In this case I wrote a program called icu.sh to get the latest ICU information on the province of Ontario. (I am concerned Covid is going to come roaring back and the ICUs will fill up again.) ICU.sh runs a curl command and in conjunction with the tail command gets the latest ICU data from an online CSV file. ICU.sh then calls a python program to parse that CSV data and get the ICU information I want.

I learned several lessons from writing this code. First, when it comes to scraping HTML, it’s necessary that the page is well formed and consistent. In the past I tried scraping complex web pages that were not and I failed. With the COVID data and the obituary data,  those pages were that way and I succeeded. Second, not all scraping is going to be from HTML pages: sometimes there will be CSV or other files. Be prepared to deal with the format you are given. Third, once you have the data, decide how you want to publish / present it. For the COVID and ICU data, I present them in a simple manner on twitter. Just the facts, but facts I want to share. For the obit data, that is just fun and for myself. For that, I spit it into a temporary HTML file and open it in a browser to review.

If you want to see the code I wrote, you can go to my repo in Github. Feel free to fork the code and make something of your own. If you want to see some data you might want to play with, Toronto has an open data site, here. Good luck!

 

if you want cheap land, Cape Breton is an option

I mean, seriously. As the local news says, there is….Still time to become a property owner for $600 in Cape Breton Regional Municipality | SaltWire

Now you aren’t going to get a mansion or anything, but clearly if owning land is your chief goal, that’s one way to do it.

Four good pieces on my hometown, Glace Bay

Anyone with an interest in Glace Bay will find these worth reading:

  1. A COAL TOWN FIGHTS FOR ITS LIFE | Maclean’s | MARCH 15 1954: this was fascinating. A story from Maclean’s Magazine in the 1950s that documented Glace Bay at the crossroads. So much in this piece explains my home town and the people who lived there.
  2. Glace Bay hockey rink’s new name closer to its roots | CBC.ca: a mainstay of Glace Bay is the hockey rink. When I was a kid I lived about 100 meters from it. I spent most of my early days (until grade 10) going to it. So many memories back then revolved around that building.
  3. KEN MACDONALD: Remembering the miners | Local-Lifestyles | Lifestyles | Cape Breton Post: a good piece from the local paper on the mines of Glace Bay and the miners who lived and sometimes died in them.
  4. Miners’ houses: Lawren Harris in Glace Bay – Nova Scotia Advocate: finally this piece on Glace Bay with a focus on a famous painting of Glace Bay by Lawren Harris (shown above). It used to be in the AGO and I often paused to reflect on it, and my hometown. Just like I am doing now.

Authentic rum is coming to the Fortress of Louisbourg in Cape Breton

Thanks to the folks at Authentic Seacoast and Parks Canada, it looks like rum and the rum trade will be coming to the historic site in Cape Breton, Nova Scotia. The news release says:

After almost 300 years, rum is once again being stored behind the massive stone walls of the Fortress of Louisbourg National Historic Site.

Authentic Seacoast Distilling Company Ltd., Parks Canada and Fortress Louisbourg Association are collaborating on a multi-year project to enhance the visitor experience at the Fortress through an authentic interpretation of the historical rum trade of 18th century New France. The Magazin du Roi will serve as a warehouse to mature carefully selected Caribbean aged rums for use in special edition Authentic Seacoast Distilling Company rums.

Sounds like a great idea. Rum and the rum trade is a not insignificant part of Nova Scotian history. It’s great to see this. For more on it, see: Authentic Seacoast™ Company Media Centre press release,  Rum Returns to Fortress of Louisbourg National Historic Site.

Get off the Cabot Trail and get on the Fleur-de-lis Trail in Cape Breton

I think the Cabot Trail is beautiful. I understand why people head there and take it in.

There are other parts of Cape Breton to see and drive, and if you like driving, I recommend the Fleur-de-lis Trail. Whenever I am driving from Halifax to Glace Bay, Cape Breton, I make sure I get off the Transcanada Highway and go along that “old highway” instead. The scenery is gorgeous, and the road is fun to drive. You know all those car commercials on TV where people are driving on highways and you think, “yeah, sure, there’s no place like that for real people to drive along”. Well, if you go along the Fleur-de-lis Trail, you can.

(Bonus, it used to be mostly a 2 lane highway, but now it is more and and more a 3 lane highway, meaning you never get stuck for long behind slow drivers if you want to drive faster. Though with all that scenery, why drive too fast?)

(This wonderful autumn photo of Cape Breton is from paellaking’s photostream on flickr. Seriously, this is the way most of the trail is, when you aren’t driving by fantastic lakes).