Skip to content

Instantly share code, notes, and snippets.

View yesdeepakmittal's full-sized avatar
😀
Working from home

Deepak Mittal yesdeepakmittal

😀
Working from home
View GitHub Profile
@stvar
stvar / youtube-search.py
Last active June 20, 2023 14:23
Find YouTube channel IDs by custom URLs or user names
#!/usr/bin/python3
# Copyright (C) 2020 Stefan Vargyas
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@JonathanReeve
JonathanReeve / brown-corpus-categories
Created May 3, 2015 22:48
Export Brown Corpus categories to text files using NLTK.
import nltk
from nltk.corpus import brown
for category in brown.categories():
words = brown.words(categories=category)
text = " ".join(words)
filename = category + '.txt'
outfile = open(filename, 'w')
outfile.write(text)
outfile.close()