Skip to content

Instantly share code, notes, and snippets.

@kennethreitz
Created August 11, 2017 04:22
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 kennethreitz/f3c40c5bfff91702e4ca4df3bb78399f to your computer and use it in GitHub Desktop.
Save kennethreitz/f3c40c5bfff91702e4ca4df3bb78399f to your computer and use it in GitHub Desktop.
Markov Kenneth Reitz
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: markovify in /opt/anaconda/lib/python3.6/site-packages\n",
"Requirement already satisfied: tweepy in /opt/anaconda/lib/python3.6/site-packages\n",
"Requirement already satisfied: requests in /opt/anaconda/lib/python3.6/site-packages\n",
"Collecting pyquery\n",
" Downloading pyquery-1.2.17-py2.py3-none-any.whl\n",
"Requirement already satisfied: unidecode in /opt/anaconda/lib/python3.6/site-packages (from markovify)\n",
"Requirement already satisfied: requests-oauthlib>=0.4.1 in /opt/anaconda/lib/python3.6/site-packages (from tweepy)\n",
"Requirement already satisfied: six>=1.7.3 in /opt/anaconda/lib/python3.6/site-packages (from tweepy)\n",
"Collecting cssselect>0.7.9 (from pyquery)\n",
" Downloading cssselect-1.0.1-py2.py3-none-any.whl\n",
"Requirement already satisfied: lxml>=2.1 in /opt/anaconda/lib/python3.6/site-packages (from pyquery)\n",
"Requirement already satisfied: oauthlib>=0.6.2 in /opt/anaconda/lib/python3.6/site-packages (from requests-oauthlib>=0.4.1->tweepy)\n",
"Installing collected packages: cssselect, pyquery\n",
"Successfully installed cssselect-1.0.1 pyquery-1.2.17\n"
]
}
],
"source": [
"!pip install markovify tweepy requests pyquery"
]
},
{
"cell_type": "code",
"execution_count": 134,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"P.S. your API is a user interface\n",
"just used fstrings for the first time.\n",
"There are 16 circles in this image.\n",
"Backup your GitHub repos with BackHub! \n",
"If you've ever wanted to chuck a mug trying to do math on timestamps, this Python library is for you \n",
"Teleconverter acquired! \n",
"Getting a full copy of wikipedia running locally!\n",
"Current status \n",
"got a speedtest server setup for the home network. fun results!\n",
"Only downside I’ve come across so far in this wonderful little machine.\n",
"12” Macbook overheats in the sun, after about an hour.\n",
"Just Google “speed test”.\n",
"Google’s built-in speed test works *way* better than \n",
"Optimized the wifi network tonight. Router had this dumb \"Enable 20/40 MHz Coexistence” mode enabled.\n",
"So satisfying\n",
"$ brew install neofetch\n",
"\n",
"\n",
"Ubuntu 17.04 is nice!\n",
"What was your first pull request!?\n",
"iCloud cache has been running for like 10 hours: \n",
"Re-imaging my home server today. Fingers crossed I don’t mess anything up. \n",
"\n",
"Switching from Ubuntu Server to Desktop while I’m at it!\n",
"Now running my own Open Directory server, which auto-mounts my NFS shares on all my computers. I'm a little IT department.\n",
"Just disabled SMB on my NAS. NFS all the way!\n",
"The caching is definitely the best OS X Server feature.\n",
"Running my own iCloud/App Store/etc caching server for my local network. It's awesome.\n",
"Turns out, Sprint turned on \"short code blocking\" on my account — had to call them to turn it off.\n",
"Been having trouble with 2fa lately with my primary phone number.\n",
"My Fuji x100F is serving me very well, indeed. The Leica will be missed, but it’s been unused since the Fuji showed up. Reality.\n",
"Sold my Leica Q. About to go ship it off. End of an era. :(\n",
"\"The Reality of Developer Burnout\" by \n",
"iSCSI now.\n",
"yay\n",
"TIL ctrl T sends SIGINFO to your process, like mv, and it’ll tell you what’s going on.\n",
"Man, having a home VPN setup is *so convenient*.\n",
"Got iCloud to sync with my Synology. Achievement unlocked!\n",
"SUCCESS!!!!\n",
"Epic success (i think!)\n",
"Successfully installed Ghost on a DO box, for a blog. Took a gig of RAM to resolve all its deps.\n",
"so many deps i ran out of ram\n",
"holy hell node stuff has a lot of deps\n",
"\n",
"i mean wow\n",
"Progress is being made!\n",
"Attempts to get Sierra running in VirtualBox are proving fruitless.\n",
"Man, NFS is basically the best thing ever.\n",
"Lve how \n",
"I am now intimately familiar with Digital Ocean. Am a fan.\n",
"WOW nfs is faster than cifs\n",
"A new favorite: Hypnagogia (ft. Terence McKenna) by \n",
"Finally starting to really fully utilize my Synology. What a fantastic appliance.\n",
"My Synology is now also my local DHCP (instead of my router). I really am digging this setup.\n",
"My Sublime setup is, well, sublime.\n",
"Got a home VPN server running! Very fancy :)\n",
"Wow, that's amazing. I ordered a print version via Amazon. Very happy to learn that it helped \n",
"Got my Synology serving DNS and takin' names.\n",
"Scientists write iffy tools.\n",
"This computer is adorable \n",
"Having all my repos sync over iCloud is a dream.\n",
"Learning a lot about MongoDB today. Thanks, \n",
"New homescreen \n",
"Semantic UI \n",
"This is a product \n",
"Why you need a 29W charger for your iPad Pro (latest gen)\n",
"Scooter repairs (taking longer than expected) \n",
"And we have pyquery a jquery like way of traversing HTML making XPath looking like a dinausor. PyQuery + requests = \n",
"\n",
"The requests lib for \n",
"New EDC! A ballpoint! Got tired of the complications of fountain pens for non–desk use. \n",
"Python is Poetry \n",
"So tremendously happy with this 12” MacBook. It served me very well today.\n",
"Kate Heddleston \n",
"Current status: \n",
"Memories \n",
"I had an extremely productive day.\n",
"All booked for DjangoCon US 2017! :D \n",
"Crossing boundaries.\n",
"“A grid system for humans”\n",
"My bank keeps its policies up-to-date on GitHub, with diffs. Does yours? \n",
"P.S. Here's the pen I decided on. Tired of carrying around fountain pens. I love them, but too much effort for EDC.\n",
"Fully switched over to Tweetbot. So many missed at-replies, I'm so sorry, y'all! \n",
"LIke, I really want to go to the coffee shop and work — but... I'm going to stay in my home office instead. Because.\n",
"To be clear, I'm referring to Vyvanse, my ADD medication (which I've been taking in some form or another for about 6 months now).\n",
"This explains *so much* about my want-to-stay-in-my-office behavior.\n",
"\"Individuals taking therapeutic doses of amphetamine develop a Conditioned place preference for where they consumed the drug.\"\n",
"Why is Python 50% faster under Windows Subsystem for Linux?\n",
"The search for the perfect (non Parker Jotter) ballpoint pen begins.\n",
"Selling my beloved Leica Q! \n",
"Selling a MacBook Pro!\n",
"My nicotene habit (which brings me great joy) costs me ~$270/month. Making mechanical adjustments to reduce costs.\n",
"Sleep schedule is horribly messed up. May pull an all–nighter to correct it.\n",
"Jebus ==> This operation has freed approximately 19GB of disk space. Thanks for the tip ;-)\n",
"Switching, because \n",
"Ah cool, using Tweetbot is like having Twitter before they made all those shitty changes.\n",
"Downgrading iPhone from iOS 11.\n",
"My games *technically* run on the pocketchip \n",
"I love RescueTime\n",
"Does this happen with Tweetbot? That’d be enough to make me switch.\n",
"Managed to finally fill up my 512GB iPad Pro yesterday, thanks to Plex! Only 60GB free, which I'm very comfortable with.\n",
"Going to try to add a manpage to pipenv today.\n",
"\"What happens when you type \n",
"Things that bother me, above all else — non–selectable text in web browsers (I'm looking at you, Facebook).\n",
"Clint was my most ambitious project and I never finished it (no docs). \n",
"\n",
"Anyone want to help?\n",
"Here’s my “setup the CLI env” script \n",
"Working on a blog post sharing my computer bootstrapping setup (what I’ve been doing all week).\n",
"One of my only tasks today is downgrading my phone from iOS 11. It works *great* on the iPad, but really kills battery life on the iPhone.\n",
"TIL \"$ brew cleanup\"\n",
"\n",
"==> This operation has freed approximately 3.0GB of disk space.\n",
"I can, however, endorse terminal-notifier and the 'done' fish package! absolutely fantastic.\n",
"homebrew-autoupdate \n",
"Attempted fix to random apps on OSX (like VLC) suddenly not being able to store preferences \n",
"After attending many conferences, I've realized:\n",
"\n",
"I don't attend to learn. \n",
"\n",
"I attend to learn what I need to learn.\n",
"\"What happens when you type \n",
"Twitter is a strange concept.\n",
"Going to attempt to selectively backup my NAS to Google Drive now that Amazon doesn't offer unlimited storage anymore.\n",
"Comcast: 1364GB used this month (July 01 - July 31).\n",
"I don't know how I could survive on this planet without \n",
"I'm in an infinite PayPal account verification loop.\n",
"Amazon Dash Button for Red Bull. Can’t tell if awesome or sad. \n",
"SuperSphere is now available on the iOS app store!!!!!\n",
"Damn it \n",
"$ brew install git-open\n",
"People make some stupid programming languages.\n",
"I had no idea iTerm had auto-complete built-in (cmd+;)\n",
"$ grew install grc\n",
"$ grc ping 8.8.8.8\n",
"shellcheck is terrifying\n",
"A collection of some of the best Sublime Text packages, themes, and goodies.\n",
"$ brew install python\n",
"\n",
"now results in python2 and pip2\n",
"\n",
"<3\n",
"Updated my slides on \"The Reality of Developer Burnout\"\n",
"Now that everything's finally synced up, I'm *very* happy with my iCloud Drive – based setup. Dotfiles, repos, Apps are all in sync.\n",
"Anyone looking to hire the best Pythonista I know to do extremely important open source work? \n",
"P.S. It's free!\n",
"SuperSphere is now available on the iOS app store!!!!!\n",
"Looks like SuperSphere will be in the iOS app store within 24 hours!\n",
"Finally got my iMac out of the MacOS beta cycle. Turns out there's a little checkbox under System Preference's \"App Store\" section.\n",
"I don’t get why everyone hates on \n",
"$ brew install heroku\n",
"\n",
"so satisfying \n",
"$ brew install nnn\n",
"\n",
"pretty neat\n",
"Vanilla is my new favorite Mac app \n",
"TIL that Siri on the Mac’s keyboard shortcut is “hold command space”\n",
"My cat has learned English!\n",
"Fully migrated from Dropbox to iCloud. Even using it to store Apps now!\n",
"Oh, yes I do. \n",
"Uninstalling the beta.\n",
"$ brctl log --wait --shorten\n",
"\n",
"the most beautiful console logs I’ve ever seen in my life.\n",
"0:38 up 1:35, 2 users, load averages: 53.41 31.26 25.99\n",
"Only downside so far of High Sierra is no pre-made bottles for homebrew.\n",
"Hope I don’t regret this.\n",
"Side-effect: I now have a gold MacBook.\n",
"Upgraded to the 2017 model MacBook 12”. The 2016’s keyboard and battery was enough to warrant a return (happening tomorrow).\n",
"My favorite part of Lua so far is that modules can return things.\n",
"Plus, it features the best track off my latest album :)\n",
"Super Sphere II has builds available for MacOS, Windows, and Android right now. It's really fun and challenging!\n",
"I slaved away all day yesterday on Super Sphere II! It's in a good state now :) Play and give feedback!\n",
"Super Sphere II is coming along well!\n",
"Liking Lua more and more!\n",
"Got to watch some friends play my game today for ~30 minutes straight. Very heart-warming :)\n",
"I’ve learned about so many great libraries and tools now since I made my first game. Now, I’m struggling to come up with something as fun :)\n",
"Thank you very much, \n",
"This is an expensive hobby.\n",
"Applied to the Steam store! $100. Hopefully that won’t be too hard to submit an App to…\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Here's a preview of what I've been working on tonight. Not as good... \n",
"Amazing how quickly my Lua is improving!\n",
"hump is basically my favorite thing ever, right now (for löve2d)\n",
"Really struggling to come up with a second game concept. Lots of cool demos, but nothing playable.\n",
"Requester for Sublime Text — Powerful, modern HTTP client built on top of the Requests library\n",
"Installing...\n",
"Super Sphere is now available (for free) from the Android Play Store! \n",
"r = requests.get(‘coolness’) \n",
"\n",
"\n",
"I coded myself into quite a hole here.\n",
"I absolutely love game programming. It's amazing how long 0.1s seconds is\n",
"Game #2 in progress \n",
"Super Sphere is now available on itch.io!\n",
"Awesome Lua: A curated list of quality Lua packages and resources.\n",
"Super Sphere is now submitted to the Google Play Store! \n",
"Here's a quick video of Super Sphere gameplay. It's super challenging, but addictive! \n",
"The App Store version will be $1.99, but you can always download free builds on GitHub!\n",
"Officially submitted Super Sphere to the iOS App Store! Whew, that was a lot of work! \n",
"Finally!\n",
"Xcode is *so* incredibly complicated. I'm utterly amazed at how complex this apparently simple piece of software is. It's *very* deep.\n",
"Code signing has to be the biggest BS I've ever encountered.\n",
"(nsfw) photo shoot from today — turned out *really* well!\n",
"And just like that, 103GiB of free space. Dropbox selective sync bug.\n",
"Storage is full on my 5K iMac. Amazing how OS X just stutters and dies when it runs out of free space, even with 32GB of RAM.\n",
"Got very wet at another photo shoot today. The photos turned out excellently, though! Uploading soon :)\n",
"Generate clean, intuitive API documentation with code examples and more with Slate 2.0: \n",
"Have you ever tried the Heroku Console in the browser?\n",
"It's like doing `heroku run` (`bash` etc) but from the web. So cool!!! :D\n",
"It works great on my android device, but who knows, maybe it’s hella slow on yours!\n",
"Alright, I’m looking for Android users! Anyone up for testing this unsigned apk for me? \n",
"I guess I know Lua now! Neat little language.\n",
"Super Sphere v6 (pre-release) is out! Aiming for the App Stores, soon.\n",
"Games are hard.\n",
"Super Sphere runs great everywhere, except iOS. It definitely works, but needs some love. Works perfectly on android, etc, though.\n",
"New release is out! proper icons and stuffs for android, osx, and windows\n",
"Man, Xcode is fancy.\n",
"Picked up an Android tablet for testing! Things are getting serious ;)\n",
"Super Sphere build for Windows is available!\n",
"Next experimental build of Super Sphere is ready, including an Android APK!\n",
"GitHub be down.\n",
"Got Super Sphere running smoothly on iOS now!\n",
"Experience with pip+virtualenv was bad.\n",
"Thanks to \n",
"Current project: attempting to package the game up for Android. Then, moving on to iOS :D\n",
"Super Sphere’s codebase is available on GitHub!\n",
"Super Sphere is going to target all major platforms and app stores.\n",
"I’ll be targeting iOS as well :) Runs great in the simulator.\n",
"Here’s a windows build too!\n",
"Very happy with the game I wrote for OSX yesterday! Here’s the latest build: \n",
"I made a mac game today! All my music and stuffs :) \n",
"Found some code that gives Lua object-oriented features. Going to give that a shot.\n",
"Attempting to play around with Kivy. So far, it seems very poorly packaged.\n",
"New blog post! I'm happy to announce that my third studio album, \"Resolution\", is now available!\n",
"The B&W P7s (Wireless) continue to be my favorite headphones ever made. So good. \n",
"\n",
"Nothing brings me happiness more than good headphones.\n",
"P.S. Scipy works great on Heroku now, thanks to them recently shipping manylinux wheels!\n",
"Python 3.6.2 is now default on Heroku. \n",
"Made an \"Intro to Kanye West\" playlist for a friend — progresses from humble & skilled to self-obsessed \n",
"Python 3.6.2 is now available on Heroku!\n",
"Took the day off, but currently building Python 3.6.2 for Heroku :)\n",
"Whee! Python 3.6.2 is out. \n",
"I'm finding Lua very frustrating to work with, for Love2D, but also intoxicatingly fun/easy. Fair trade off for inspiration, I suppose.\n",
"12\" Macbook has the loudest DAC I've ever heard in a laptop, by far. Thing gets *loud*. Prob an impedance thing.\n",
"I'm amazed at how much I forgot how much I love Chevelle.\n",
"Really enjoying the 12\" Macbook.\n",
"I have the best wife in the world :)\n",
"KORG Gadget on the desktop may be a possible replacement for Ableton for me, for laptop-only music-making.\n",
"Really loving KORG Gadget for Mac.\n",
"<3 Chevelle.\n",
"Still selling my 15\" 2017 TouchBar (maxed out) MacBook Pro, if anyone's interested!\n",
"One port won't be that big of a deal, if the battery life is as good as it appears to be.\n",
"Picking up the 12\" Macbook shortly! I saw one on a flight recently, and fell in love with the size.\n",
"“Transitions”\n",
"My current favorite iOS game is called Spaceplan — and I may base my design a lot on it’s mechanics... maybe. \n",
"Also, Unity seems unapproachable.\n",
"Picking a platform is hard, but leaning towards Löve, as it claims to have a good distributable story for most platforms.\n",
"I may start spending my time building a video game! I want to make all the programming, sounds, and art myself :)\n",
"Check out my new album \"Resolution\" on Google Play! \n",
"My new album, \"Resolution\" is now available for free streaming on Spotify!! \n",
"Me drumming to Chop Suey by System of a Down! (video taken by my brother :) \n",
"Uploading an Android-taken video to Facebook (or doing anything with it, really) is like pulling teeth.\n",
"My new album, \"Resolution\" is now available for free streaming on Spotify!! \n",
"Check out my new album \"Resolution\" on Google Play! \n",
"I’m long overdue for a new episode of Import This. Anyone interested in recording an episode with me today? It takes a little over an hour.\n",
"My brand-new album, “Resolution”, is now available for streaming on TIDAL!!\n",
"New album submitted to all online digital stores! \"Resolution\"\n",
"Stay out of my Dreams\n",
"FYI, AirPods to not survive a standard wash cycle.\n",
"New (rather excellent, compared to usual) track, \"Waking Nightmare\"\n",
"A new favorite: Hypnagogia (ft. Terence McKenna) by \n",
"New track!\n",
"Got an MFI controller for my iPad, and now games are amazing on it :)\n",
"Not dead yet \n",
"Today is my 3 year anniversary!\n",
"According to GeekBench, my iPad Pro is like 95% as powerful as my 5K iMac.\n",
"Someone wrote a blog post about my website! :)\n",
"The Far Side of Madness \n",
"Dinner with a Narcissist \n",
"On Traveling and Depression \n",
"Had to get wet today for a photo shoot!\n",
"If you're not already using \n",
"Listening to a podcast interview with \n",
"KENNETH REITZ\n",
"\n",
"The 29W USB-C charger for the iPad Pro is *amazing* — can’t recommend it enough.\n",
"Convinced that if I wasn't as technical as I was, an iPad would be the only computer I'd need. Software could solve that, though.\n",
"Only in San Francisco\n",
"Migrating from Dropbox to iCloud for Desktop/Documents tonight.\n",
"New track! \n",
"Anyone looking for a (really) junior level Python dev?\n",
"Really looking forward to Dropbox supporting the Files app on iOS 11!\n",
"Got more funky styles than my laser jet’s got fonts.\n",
"It’s a 311 kind of day.\n",
"Hooked on Phonics \n",
"iOS 11 is pretty nifty!\n",
"New iPad is basically the best.\n",
"New iPad Pro 10.5\" acquired!\n",
"Updated my 500px profile with some street images from Pride!\n",
"Anyone seen Jake? \n",
"Hey Mr. DJ \n",
"Family band \n",
"Mural \n",
"Haight \n",
"Radial \n",
"Images are up from my last (nsfw) photo shoot!\n",
"Photos from SF Pride are up!!\n",
"Photos taken with my Fuji x100F in SF this week are up!\n",
"15” MBP with TouchBar appears to draw too much power to charge on the plane :(\n",
"Not Lenny Kravitz \n",
"Rays II \n",
"Rays \n",
"Got amazing pictures yesterday at Pride! Editing now :)\n",
"SF \n",
"David Züelke \n",
"Old stickers are still a thing! /cc \n",
"Yesterday at pride \n",
"I'm at San Francisco International Airport - \n",
"The \n",
"Updated my 500px with some stellar (nsfw) images from this week!\n",
"Updated my model photography portfolio with some new shots from this week! \n",
"Anyone in SF want to grab lunch?\n",
"Accidentally signed up to be an Uber driver. Apparently that’s a single button press somewhere.\n",
"Murder \n",
"Last time in the Heroku office (we're getting a new one)!\n",
"Periodic reminder that dotfiles being invisible in Unix was originally a bug in `ls` that they decided to promote to feature rather than fix\n",
"OH: \"free as in soy\"\n",
"I'm at ThirstyBear Brewing Company in San Francisco, CA\n",
"I love San Francisco :)\n",
"Python 3 is now default on Heroku! \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"I'm at \n",
"Off to San Francisco!\n",
"Loving the new Twitter for iOS.\n",
"I'm at Washington Dulles International Airport - \n",
"Dr. Suess \n",
"Frozen in time \n",
"19 \n",
"Harmony \n",
"Design \n",
"VLC Board Meeting \n",
"Epic door \n",
"Boundaries \n",
"GIVE ME COFFEE \n",
"Growth \n",
"Current status: manually shipping tons of stickers :)\n",
"CURL DOESN’T SPEW BINARY ANYMORE \n",
"I got \"Requests\" Stickers on \n",
"Fulfillment (if all goes according to plan) will be done by \n",
"If anyone wants a Requests sticker, they are available to order on \n",
"okay *now* they're available to purchase :)\n",
"Requests stickers are now available to order! \n",
"Currently exploring \n",
"Wish there was a \"send stickers all over the world as a service\". I offered to send stickers to two people and now my inbox is flooded :)\n",
"Official Requests stickers have arrived! \n",
"Learning about the inner workings of the PSF is mesmerizing, in a good way! Great organization. \n",
"I feel like a photography/music has-been. I intend to change this.\n",
"Requests v2.18.1 released!\n",
"My EarPods have mysteriously stopped working :(\n",
"Any SF'ers want to get together next week? I'll be in town 19th–25th June!\n",
"Tenacity — a retrying library for Python\n",
"Looks like I made it on the PSF board! \n",
"Don't change things that work! \n",
"I get the impression that more people are using Maya than I realize. If that's true, that's awesome! Y'all have good taste :) \n",
"I was 21/22 when Requests became popular. Everything's been a blur since then :)\n",
"Couldn't remember how old I am.\n",
"One thing that annoys me about Apple\n",
"Wow, \n",
"Swapped buttons out :) \n",
"which sucks, because I have 7.84 TB uploaded :(\n",
"\"Amazon no longer offers an unlimited storage plan.\" :(\n",
"Python 3.6.1 becomes default Python runtime Tuesday, June 20th, 2017 \n",
"The email \n",
"Delegator.py v0.0.11 published, which introduces the timeout parameter! Thanks, @Jetblackope5! \n",
"Not 100% sold on the idea of selling it, but if the right person is interested, it'll be an easy decision.\n",
"Anybody interested in buying a well-cared-for Leica Q? I absolutely love it, but haven't really touched it since I got my Fuji x100F.\n",
"Time for \n",
"This 'worst volume slider' contest is UX gold: \n",
"Here’s a gist showing how to use \n",
".\n",
"I remember when Twitter was pretty new just constantly searching for *anyone* talking about Python. Times have changed!\n",
"Fidget spinners have really helped me smoke a lot less (e-cigs)!\n",
"I got a surprise in the mail today!!! \n",
"Shoutout to \n",
"\"Testing Python-Requests with Betamax\"\n",
"Addicted \n",
"Learning about BigAutoField in Django, and wishing it was default.\n",
"Internet's back up! \n",
"Just ordered 1500 real Requests stickers, thanks to \n",
"Current status \n",
"Home internet is *down*.\n",
"On June 20th, all new Heroku Python apps will default to using Python 3! \n",
"On June 20th, all new Heroku Python apps will default to using Python 3! \n",
"Inbox Zero! (ish)\n",
"Does your large organization use Requests? Tweet their name at me, so I can throw it up on the homepage!\n",
"Accidentally processed 28.247 Tebibytes of data yesterday.\n",
"On my tombstone, it will just say: \"He is not waiting for that appveyor build any more.\"\n",
"recentRegionSpread \n",
"17.5% of all installs this month (of all packages) are done with Python 3!\n",
"Gonna try GraphQL first chance I get. Skimmed through the docs today, looks inviting :)\n",
"Hear and follow \n",
"However, Django installers this month are using Python 3 at a 66.1% rate! \n",
"Flask was installed more times than Django this month. 10k more times per day! \n",
"recentTopPackages \n",
"GraphQL is amazing!\n",
"My API now supports downloads, recentDownloads, recentPython3Adoption, & recentPythonVersionSpread! \n",
"Here's something useful: \n",
"boom\n",
"you can play with the early prototype here: \n",
"Current status\n",
"httpbin traffic \n",
"Google BigQuery Now Allows to Query All Open-Source Projects on GitHub \n",
"Work in progress: \"a PyPI downloads information web service, using GraphQL (and Flask!) \"\n",
"BinVer: v0 is latest unstable release, v1 is latest stable release. There are only two released versions at any time.\n",
"New track!\n",
"Thinking of exposing PyPi download data over GraphQL\n",
"New track!\n",
"My photos from Revolution Conf are up! \n",
"Pipenv v5.0.0 also introduces the PIPENV_DEFAULT_THREE environment variable, as a nice shortcut to passing --three all the time.\n",
"Pipenv v5.0.0 released, which automatically uses active virtualenvs when they are available!\n",
"<3 \n",
"Amazon claims to have a copy of The Hitchhiker's Guide to Python available from 1774! \n",
"Requests-Toolbelt is now available in the Requests GitHub org!\n",
"I met a lot of JS devs this week. Good people.\n",
"Revolution conf was amazing; thanks to all of the organizers for putting on such an excellent regional conference :-)\n",
"You should follow \n",
"Another reminder that most critical Python infrastructure (pip, setuptools, pypi) has just 1 core maintainer/admin *on a good day*\n",
"Conferencing in socks today \n",
"It appears as though a collective of hackers recently discovered Requests, maybe. Tweets and things.\n",
"GraphQL is super cool!\n",
"\"Don't tread on Heroku\" - \n",
"I worked my way through all of the back catalog of \n",
"Good! \n",
"We had a wonderful meetup today. Talked about Consuming APIs using requests\n",
"We are having a Python meetup today at 6pm. Location: Hivecolab\n",
"I'm at Wyndham Hotel in Virginia Beach, VA\n",
"Whipped up an example using requests to consume twitter’s streaming API, realized others might find it useful: \n",
"Thanks to \n",
"Off to RevConf!\n",
"This is my life now \n",
"Going to VA Beach in the morning!\n",
"When comments on GitHub get heated, now you can limit interactions and get to better solutions after some time away.\n",
"Life hack. If you are getting into python, take the time to read the documentation for requests\n",
"I forgot what year it was for a second.\n",
"There's a PR open to Django to Integrate dj-database-url functionality!\n",
"Can we all thank \n",
"What I've been up to this weekend™\n",
"thanks \n",
"What I've been up to this weekend™\n",
"just switched and yes, you should probably use direnv.\n",
"Use autoenv? You should probably use direnv instead \n",
"no, no. Drop an f-string in there next time.\n",
"Sorry to anyone who was bit by any backwards incompatible changes over the weekend! They're all patched up now, won't happen again :)\n",
"requests - Python HTTP Requests for Humans™\n",
"Requests v2.17.0 is out! Thanks, \n",
"Finally setup pinned repos on my GitHub page!\n",
"Requests has moved it's codebase to it's org, away from the kennethreitz namespace!\n",
"Requests' infrastructure is now running out of my living room and I am thrilled. :)\n",
"Current status \n",
"Bought a home server to run Jenkins on. Tonight will be *fun*!\n",
"My favourite game when watching a new Disney Animation Studios movie is to find \n",
"Maya's getting a lot of love lately from contributors!\n",
"Got my first thank you via SayThanks.io Great addition to any README file. Thanks for creating this \n",
"I wouldn't mind starting a reasonable CI company. There aren't many (any?) out there. AppVeyor really sucks.\n",
"Almost–monthly-costs today for a new CI setup. Didn't work out. \n",
"The excellent \n",
"You may be the entire Python community, but you could never replace this fidget spinner, in my heart.\n",
"I spend $100 / year on the font that's featured on \n",
"Idk, there's something refreshing about just tweeting random uncensored shit sometimes.\n",
"I should probably be writing in my online journal thing instead of on Twitter, but...\n",
"I'm in a very good mood. If any of that came across otherwise, my apologies :)\n",
"When the people behind software are less important than the software itself, something is very wrong with that situation.\n",
"The point of sharing this.... I guess to keep things real. There are far more important things in life than software. Sanity is one of them.\n",
"In other news, I haven't had a psychotic break since October, so I've always got that going for me :P\n",
"Seriously though, this is way better! That too.\n",
"\n",
"Just the boredom is the driving force over leaving things the same.\n",
"Same reason I made .json .json() so many years ago. Boredom. :P\n",
"So, if anyone's wondering why I unvendored Requests' dependencies it was because people have been asking for it for years and I was bored.\n",
"That 410 GONE move is so tempting sometimes. \n",
"\n",
"But, I always do the opposite. I iterate instead of deleting. Keeps things fresh.\n",
"This series of tweets brought to you by mostly no one. Today was great. Very productive. Very happy with said changes :)\n",
"And the best part is, if you don't like my software, you don't have to use it (or work on it!) :D\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Having half the internet using your shit can be really annoying. Things went really smoothly today, imo. Change is good.\n",
"Very glad people are using and enjoying it, though. I know I do :)\n",
"Pipenv really feels like a waste of time sometimes.\n",
"People take software too seriously. It should be taken seriously, of course, but not to the extent that it often is.\n",
"Current status\n",
"OH \"Gotta keep those people on their toes!\"\n",
"I may have ordered a high-end fidget spinner this week with full-ceramic bearings. PyCon has ruined me forever.\n",
"Well, the internet didn't blow up today. I guess I'm doing something right.\n",
"Flask's CI Matrix was 42 builds. Now it's 22. When I'm done it will be... fewer....\n",
"Maya v0.3.2 released!\n",
"Testing Datetime libraries is surprisingly difficult.\n",
"Requests v2.16.2 released, which restores backwards import compatibility for the vendored packages that were removed from the codebase.\n",
"sys.modules to the rescue!\n",
"who wrote this shit ~ Kenneth Reitz ~\n",
"Just realized how appropriate the Requests logo will be once we're running on Twisted :D\n",
"In the coming year, Requests will be able to rely on system certificates on Windows, OS X, and Linux. Natively.\n",
"Version checks are done at import time, to assure that appropriate versions are installed.\n",
"Requests no longer vendors urllib3's source code, and it gets installed as a dependency.\n",
"Requests no longer ships its own CA bundle — it simply relies on Certifi to provide one, always.\n",
"Paving the way for Twisted!\n"
]
}
],
"source": [
"import requests\n",
"from pyquery import PyQuery as pq\n",
"\n",
"account = 'kennethreitz'\n",
"url = f'https://twitter.com/i/profiles/show/{account}/timeline/tweets?include_available_features=1&include_entities=1&include_new_items_bar=true'\n",
"headers = {\n",
" 'Accept': 'application/json, text/javascript, */*; q=0.01',\n",
" 'Referer': 'https://twitter.com/kennethreitz',\n",
" 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8',\n",
" 'X-Twitter-Active-User': 'yes',\n",
" 'X-Requested-With': 'XMLHttpRequest'\n",
"}\n",
"\n",
"def gen_tweets(pages=8):\n",
" r = requests.get(url, headers=headers)\n",
" \n",
" while pages > 0:\n",
" d = pq(r.json()['items_html'])\n",
"\n",
" tweets = [tweet.text for tweet in d('.tweet-text')]\n",
" last_tweet = d('.stream-item')[-1].attrib['data-item-id']\n",
" \n",
" for tweet in tweets:\n",
" if tweet:\n",
" print(tweet)\n",
" yield tweet\n",
" \n",
" r = requests.get(url, params={'max_position': last_tweet, 'latent_count': latent_count}, headers=headers)\n",
" pages += -1\n",
"\n",
"tweets = '\\n'.join([t for t in gen_tweets(25)])"
]
},
{
"cell_type": "code",
"execution_count": 135,
"metadata": {},
"outputs": [],
"source": [
"import markovify\n",
" \n",
"# Build the model.\n",
"text_model = markovify.Text(tweets)"
]
},
{
"cell_type": "code",
"execution_count": 136,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Learning about the inner workings of the PSF is mesmerizing, in a good distributable story for most platforms.\n",
"Not 100% sold on the iOS app store within 24 hours!\n",
"Can we all thank What I've been working on tonight.\n",
"My Fuji x100F in SF want to grab lunch?\n",
"Going to VA Beach in the Requests library Installing...\n",
"Can we all thank What I've been up to be the entire Python community, but you can always download free builds on GitHub!\n",
"Whew, that was a lot of love lately from contributors!\n",
"12” Macbook overheats in the Requests logo will be able to rely on system certificates on Windows, OS X, and Linux.\n",
"If you've ever wanted to chuck a mug trying to do extremely important open source work?\n",
"Got tired of the MacOS beta cycle.\n",
"Going to VA Beach in the sun, after about an hour.\n",
"“Transitions” My current favorite iOS game is called Spaceplan — and I may have ordered a print version via Amazon.\n",
"I don’t get why everyone hates on $ brew install neofetch Ubuntu 17.04 is nice!\n",
"So cool!!! :D It works great on Heroku now, thanks to Current project: attempting to package the game I wrote for OSX yesterday!\n",
"Can we all thank What I've been working on tonight.\n",
"Tonight will be in the morning!\n",
"I saw one on a DO box, for a new CI setup.\n",
"Updated my model photography portfolio with some street images from Pride!\n",
"So cool!!! :D It works *great* on the PSF is mesmerizing, in a very good mood.\n",
"Thanks to Current project: attempting to package the game I wrote for OSX yesterday!\n",
"If you've ever wanted to chuck a mug trying to do extremely important open source work?\n",
"SuperSphere is now available on the iPad, but really kills battery life on the PSF board!\n",
"According to GeekBench, my iPad Pro is *amazing* — can’t recommend it enough.\n",
"Whew, that was a lot of JS devs this week.\n",
"Anyone up for Android.\n",
"I get the impression that more people are using and enjoying it, though.\n",
"Got tired of the PSF board!\n",
"Here’s the latest build: I made it on the PSF is mesmerizing, in a good way!\n",
"Thanks to Off to San Francisco!\n",
"Almost–monthly-costs today for a blog.\n",
"Anyone looking to hire the best thing ever.\n",
"There are 16 circles in this wonderful little machine.\n",
"I may base my design a lot of love lately from contributors!\n",
"I'll be in the morning!\n",
"Updated my 500px profile with some new shots from this week!\n",
"I'm amazed at how much I forgot what year it was for a second.\n",
"Code signing has to be the entire Python community, but you can limit interactions and get to better solutions after some time away.\n",
"Here's a preview of what I've been up to this weekend™ thanks What I've been working on tonight.\n",
"Tenacity — a retrying library for Python Looks like SuperSphere will be in town 19th–25th June!\n",
"Learning about the inner workings of the Requests library Installing...\n",
"Hopefully that won’t be too hard to submit an App to… Here's a quick video of Super Sphere is going to stay in my heart.\n",
"Only downside I’ve come across so far is that modules can return things.\n",
"Managed to finally fill up my 512GB iPad Pro yesterday, thanks to them recently shipping manylinux wheels!\n",
"Officially submitted Super Sphere is ready, including an Android tablet for testing!\n",
"Learning about the inner workings of the MacOS beta cycle.\n",
"Tenacity — a retrying library for Python Looks like I made it on the pocketchip I love them, but too much effort for EDC.\n",
"I really want to grab lunch?\n",
"Tenacity — a retrying library for Python Looks like SuperSphere will be *fun*! My favourite game when watching a new episode of Import This.\n",
"Only downside I’ve come across so far is that modules can return things.\n",
"You should probably use direnv.\n",
"Accidentally signed up to this weekend™ thanks What I've been working on tonight.\n",
"Tenacity — a retrying library for Python Looks like SuperSphere will be *fun*! My favourite game when watching a new CI setup.\n",
"I'm going to stay in my online journal thing instead of on Twitter, but...\n",
"Fingers crossed I don’t get why everyone hates on $ brew install neofetch Ubuntu 17.04 is nice!\n",
"Requests-Toolbelt is now submitted to all online digital stores!\n",
"Can we all thank What I've been up to this weekend™ just switched and yes, you should probably be writing in my home office instead.\n",
"12” Macbook overheats in the Requests logo will be $1.99, but you could never replace this fidget spinner, in my heart.\n",
"Requests-Toolbelt is now available in the sun, after about an hour.\n",
"Python 3.6.2 is now available on GitHub!\n",
"Tonight will be once we're running on Twisted :D In the coming year, Requests will be in the sun, after about an hour.\n",
"Updated my 500px profile with some new shots from this week!\n",
"I ordered a high-end fidget spinner this week are up!\n",
"Flask was installed more times per day!\n",
"Got tired of the PSF is mesmerizing, in a very good mood.\n",
"Tenacity — a retrying library for Python Looks like I made it on the iPad, but really kills battery life is as good as it appears to be.\n",
"I absolutely love it, but if the battery life on the pocketchip I love RescueTime Does this happen with Tweetbot?\n",
"Finally got my iMac out of free space.\n",
"I should probably use direnv.\n",
"It works great on Heroku now, thanks to Current status got a speedtest server setup for the first time.\n",
"Man, having a home VPN server running!\n",
"According to GeekBench, my iPad Pro is *amazing* — can’t recommend it enough.\n",
"Talked about Consuming APIs using requests We are having a home VPN server running!\n",
"It works *great* on the PSF is mesmerizing, in a good way!\n",
"Super Sphere is going to stay in my heart.\n",
"My brand-new album, “Resolution”, is now default on Heroku.\n",
"I'm amazed at how much I love them, but too much effort for EDC.\n",
"My games *technically* run on the pocketchip I love them, but too much effort for EDC.\n",
"Updated my 500px profile with some new shots from this week!\n",
"Tonight will be once we're running on Twisted :D In the coming year, Requests will be missed, but it’s been unused since the Fuji showed up.\n",
"SuperSphere is now available in the Requests logo will be able to rely on system certificates on Windows, OS X, and Linux.\n",
"Super Sphere is going to stay in my heart.\n",
"It should be taken seriously, of course, but not to the coffee shop and work — but...\n",
"Officially submitted Super Sphere is ready, including an Android tablet for testing!\n",
"“Transitions” My current favorite iOS game is called Spaceplan — and I may start spending my time building a video game!\n",
"P.S. your API is a user interface just used fstrings for the iPad Pro is *amazing* — can’t recommend it enough.\n",
"0:38 up 1:35, 2 users, load averages: 53.41 31.26 25.99 Only downside I’ve come across so far is that modules can return things.\n",
"Thanks to Off to San Francisco!\n",
"I saw one on a DO box, for a blog.\n",
"Tweet their name at me, so I can throw it up on the iOS app store!!!!! Looks like I made a mac game today!\n",
"I really want to go ship it off.\n",
"SuperSphere is now submitted to all online digital stores!\n",
"I may base my design a lot of love lately from contributors!\n",
"Officially submitted Super Sphere is now available in the iOS app store!!!!! Looks like SuperSphere will be in the morning!\n",
"$ brctl log --wait --shorten the most beautiful console logs I’ve ever seen in my online journal thing instead of on Twitter, but...\n",
"I'll be in the morning!\n",
"The Leica will be $1.99, but you could never replace this fidget spinner, in my life.\n",
"Code signing has to be the only computer I'd need.\n",
"Very happy with the size.\n",
"I absolutely love it, but haven't really touched it since I got my iMac out of free space.\n",
"Requester for Sublime Text — Powerful, modern HTTP client built on top of the complications of fountain pens for non–desk use.\n"
]
}
],
"source": [
"# Print randomly-generated tweets.\n",
"for i in range(100):\n",
" print(text_model.make_short_sentence(140))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment