Skip to content

Instantly share code, notes, and snippets.

@mitmul
mitmul / ros_raspbian.sh
Created December 5, 2014 21:26
Prepare ROS libraries and anaconda environment for raspberry-pi
# install miniconda
cd
wget http://repo.continuum.io/miniconda/Miniconda-3.5.5-Linux-armv6l.sh
md5sum Miniconda-3.5.5-Linux-armv6l.sh
bash Miniconda-3.5.5-Linux-armv6l.sh -b
rm -rf Miniconda-3.5.5-Linux-armv6l.sh
echo 'export PATH=/home/pi/miniconda/bin:$PATH' >> .bashrc
source .bashrc
conda install pip --yes
conda install ipython --yes
@ljmccarthy
ljmccarthy / youtube_screen_scrape.py
Last active March 24, 2021 01:11
An example of how to download metadata for all videos of a specified YouTube channel using simple BeautifulSoup screen scraping. The data will be much more up-to-date and reliable than the RSS feed or YouTube API results (which is a sad state of affairs really).
import urllib
import json
from bs4 import BeautifulSoup
from collections import namedtuple
Video = namedtuple("Video", "video_id title duration views thumbnail")
def parse_video_div(div):
video_id = div.get("data-context-item-id", "")
title = div.find("a", "yt-uix-tile-link").text