{ "metadata": { "name": "", "signature": "sha256:843dec6b8a3bf6dba8d461421f67edfba0e2847e39b85dee1ada21e3b03b7b7f" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Twitter Data Collection & Analysis" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import twitter\n", "%load_ext retina # Display images with retina " ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 11 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Setup authentication..." ] }, { "cell_type": "code", "collapsed": false, "input": [ "consumer_key = \"CMHKXlMkCfpDieJBdFNQe0SDg\"\n", "consumer_secret = \"4r0BN4iMaiqkywcJf518FchlT9IEggnQY8jNJ1pr6jqx5lIXu5\"\n", "access_token = \"1358375179-yozRj6VttftJtBkYCds2Mt2F0ITlQfKt7svHVLt\"\n", "access_token_secret = \"dhwXZd9D3xbEKi3rMyqBQOL8JLVl4AehLI8cy21grZO6m\"\n", "\n", "auth = twitter.OAuth(access_token, access_token_secret,\n", " consumer_key, consumer_secret)\n", "\n", "twitter_api = twitter.Twitter(auth=auth)\n", "\n", "# Check to see if it worked\n", "if twitter_api:\n", " print ('Success')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Success\n" ] } ], "prompt_number": 15 }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can use [Yahoo!GeoPlanet's](https://developer.yahoo.com/geo/geoplanet/) Where On Earth (WOE) ID system, which is an API designed to provide an unique identifier to any named place on earth. The WOE ID for earth is 1. " ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Figure how to use this API later\n", "ap_id = '7BjgHs42'" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 35 }, { "cell_type": "code", "collapsed": false, "input": [ "WORLD_WOE_ID = 1\n", "US_WOE_ID = 23424977" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 37 }, { "cell_type": "code", "collapsed": false, "input": [ "world_trends = twitter_api.trends.place(_id=WORLD_WOE_ID)\n", "us_trends = twitter_api.trends.place(_id=US_WOE_ID)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 50 }, { "cell_type": "code", "collapsed": false, "input": [ "import json\n", "\n", "print json.dumps(world_trends, indent = 1)\n", "print\n", "print json.dumps(us_trends, indent = 1)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[\n", " {\n", " \"created_at\": \"2014-10-03T11:15:10Z\", \n", " \"trends\": [\n", " {\n", " \"url\": \"http://twitter.com/search?q=%23w%C9%AFwBayipr%D1%94ssC%C3%B8m\", \n", " \"query\": \"%23w%C9%AFwBayipr%D1%94ssC%C3%B8m\", \n", " \"name\": \"#w\\u026fwBayipr\\u0454ssC\\u00f8m\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%23BaskentAmaGeceUlas\", \n", " \"query\": \"%23BaskentAmaGeceUlas\", \n", " \"name\": \"#BaskentAmaGeceUlas\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%23ElyarFoxAnnouncement\", \n", " \"query\": \"%23ElyarFoxAnnouncement\", \n", " \"name\": \"#ElyarFoxAnnouncement\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%23WorstReplyToILoveYou\", \n", " \"query\": \"%23WorstReplyToILoveYou\", \n", " \"name\": \"#WorstReplyToILoveYou\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%23Holler3rdWin\", \n", " \"query\": \"%23Holler3rdWin\", \n", " \"name\": \"#Holler3rdWin\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%22Chelsea+Hadi%22\", \n", " \"query\": \"%22Chelsea+Hadi%22\", \n", " \"name\": \"Chelsea Hadi\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%22Bulan+Spesialmu%22\", \n", " \"query\": \"%22Bulan+Spesialmu%22\", \n", " \"name\": \"Bulan Spesialmu\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%22Udah+Sampe+Rumah+Kak%22\", \n", " \"query\": \"%22Udah+Sampe+Rumah+Kak%22\", \n", " \"name\": \"Udah Sampe Rumah Kak\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%22M%C3%B3nica+Oriol%22\", \n", " \"query\": \"%22M%C3%B3nica+Oriol%22\", \n", " \"name\": \"M\\u00f3nica Oriol\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%22Iklan+Via+TTI+082288113332+Lebih%22\", \n", " \"query\": \"%22Iklan+Via+TTI+082288113332+Lebih%22\", \n", " \"name\": \"Iklan Via TTI 082288113332 Lebih\", \n", " \"promoted_content\": null\n", " }\n", " ], \n", " \"as_of\": \"2014-10-03T11:17:56Z\", \n", " \"locations\": [\n", " {\n", " \"woeid\": 1, \n", " \"name\": \"Worldwide\"\n", " }\n", " ]\n", " }\n", "]\n", "\n", "[\n", " {\n", " \"created_at\": \"2014-10-03T11:10:29Z\", \n", " \"trends\": [\n", " {\n", " \"url\": \"http://twitter.com/search?q=%23MeanGirlsAppreciationDay\", \n", " \"query\": \"%23MeanGirlsAppreciationDay\", \n", " \"name\": \"#MeanGirlsAppreciationDay\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%23VoteVamps\", \n", " \"query\": \"%23VoteVamps\", \n", " \"name\": \"#VoteVamps\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%23BadThemeParks\", \n", " \"query\": \"%23BadThemeParks\", \n", " \"name\": \"#BadThemeParks\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%23ItsOctober3rd\", \n", " \"query\": \"%23ItsOctober3rd\", \n", " \"name\": \"#ItsOctober3rd\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%23WorstReplyToILoveYou\", \n", " \"query\": \"%23WorstReplyToILoveYou\", \n", " \"name\": \"#WorstReplyToILoveYou\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=%22Rich+Rod%22\", \n", " \"query\": \"%22Rich+Rod%22\", \n", " \"name\": \"Rich Rod\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=Oregon\", \n", " \"query\": \"Oregon\", \n", " \"name\": \"Oregon\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=Ebola\", \n", " \"query\": \"Ebola\", \n", " \"name\": \"Ebola\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=Annabelle\", \n", " \"query\": \"Annabelle\", \n", " \"name\": \"Annabelle\", \n", " \"promoted_content\": null\n", " }, \n", " {\n", " \"url\": \"http://twitter.com/search?q=Ducks\", \n", " \"query\": \"Ducks\", \n", " \"name\": \"Ducks\", \n", " \"promoted_content\": null\n", " }\n", " ], \n", " \"as_of\": \"2014-10-03T11:17:57Z\", \n", " \"locations\": [\n", " {\n", " \"woeid\": 23424977, \n", " \"name\": \"United States\"\n", " }\n", " ]\n", " }\n", "]\n" ] } ], "prompt_number": 51 }, { "cell_type": "markdown", "metadata": {}, "source": [ "To find out which trends are the same between the two regions, we use Python's `set` data structure. A set refers to the mathematical notion of a data structure that stores an unordered collection of unique items. These sets can be computed on with other sets of items using `setwise operations`. For example, a setwise intersection computes common items between sets, and a setwise union combines all the items from the sets (addition), and setwise difference acts as a subtraction operation." ] }, { "cell_type": "code", "collapsed": false, "input": [ "world_trends_set = set([trend['name']\n", " for trend in world_trends[0]['trends']])\n", "\n", "us_trends_set = set([trend['name']\n", " for trend in us_trends[0]['trends']])\n", "\n", "common_trends = world_trends_set.intersection(us_trends_set)\n", "\n", "print common_trends" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "set([u'#WorstReplyToILoveYou'])\n" ] } ], "prompt_number": 56 }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Collect some tweets based on this trending hashtag" ] }, { "cell_type": "code", "collapsed": false, "input": [ "q = '#WorstReplyToILoveYou'\n", "count = 100\n", "\n", "results = twitter_api.search.tweets(q=q, count = count)\n", "statuses = results['statuses']\n", "for _ in range(5):\n", " print 'Length of statuses', len(statuses)\n", " try:\n", " next_results = results['search_metadata']['next_results']\n", " except KeyError, e: # No more results when next_results is null\n", " break\n", " # Create a dictionary from next_results, of the form:\n", " kwargs = dict([kv.split('=')for kv in next_results[1:].split('&')])\n", "\n", " results = twitter_api.search.tweets(**kwargs)\n", " statuses += results['statuses']\n", "\n", "print json.dumps(statuses[0], indent=1)\n" ], "language": "python", "metadata": {}, "outputs": [ { "ename": "ValueError", "evalue": "Expecting object: line 1 column 353224 (char 353223)", "output_type": "pyerr", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mcount\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m100\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtwitter_api\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msearch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtweets\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mq\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mq\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcount\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcount\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0mstatuses\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mresults\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'statuses'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0m_\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/Users/ryankelly/anaconda/lib/python2.7/site-packages/twitter/api.pyc\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, **kwargs)\u001b[0m\n\u001b[1;32m 264\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 265\u001b[0m \u001b[0mreq\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0murllib_request\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mRequest\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0muriBase\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbody\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mheaders\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 266\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_handle_response\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mreq\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muri\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0marg_data\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_timeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 267\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 268\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_handle_response\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreq\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muri\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0marg_data\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_timeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/Users/ryankelly/anaconda/lib/python2.7/site-packages/twitter/api.pyc\u001b[0m in \u001b[0;36m_handle_response\u001b[0;34m(self, req, uri, arg_data, _timeout)\u001b[0m\n\u001b[1;32m 288\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mwrap_response\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mheaders\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 289\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0;34m\"json\"\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 290\u001b[0;31m \u001b[0mres\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjson\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloads\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'utf8'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 291\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mwrap_response\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mres\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mheaders\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 292\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/Users/ryankelly/anaconda/lib/python2.7/json/__init__.pyc\u001b[0m in \u001b[0;36mloads\u001b[0;34m(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)\u001b[0m\n\u001b[1;32m 336\u001b[0m \u001b[0mparse_int\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mNone\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mparse_float\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mNone\u001b[0m \u001b[0;32mand\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 337\u001b[0m parse_constant is None and object_pairs_hook is None and not kw):\n\u001b[0;32m--> 338\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_default_decoder\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 339\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mcls\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 340\u001b[0m \u001b[0mcls\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mJSONDecoder\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/Users/ryankelly/anaconda/lib/python2.7/json/decoder.pyc\u001b[0m in \u001b[0;36mdecode\u001b[0;34m(self, s, _w)\u001b[0m\n\u001b[1;32m 364\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 365\u001b[0m \"\"\"\n\u001b[0;32m--> 366\u001b[0;31m \u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mend\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_decode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0midx\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0m_w\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 367\u001b[0m \u001b[0mend\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_w\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mend\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 368\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mend\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/Users/ryankelly/anaconda/lib/python2.7/json/decoder.pyc\u001b[0m in \u001b[0;36mraw_decode\u001b[0;34m(self, s, idx)\u001b[0m\n\u001b[1;32m 380\u001b[0m \"\"\"\n\u001b[1;32m 381\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 382\u001b[0;31m \u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mend\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mscan_once\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0midx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 383\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mStopIteration\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 384\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"No JSON object could be decoded\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mValueError\u001b[0m: Expecting object: line 1 column 353224 (char 353223)" ] } ], "prompt_number": 69 }, { "cell_type": "code", "collapsed": false, "input": [ "print kwargs" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "{u'q': u'%2523WorstReplyToILoveYou', u'count': u'100', u'include_entities': u'1', u'max_id': u'518000264926601215'}\n" ] } ], "prompt_number": 67 }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.core.display import HTML\n", "\n", "\n", "def css_styling():\n", " styles = open(\"/users/ryankelly/desktop/custom_notebook2.css\", \"r\").read()\n", "\n", " return HTML(styles)\n", "css_styling()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "" ], "metadata": {}, "output_type": "pyout", "prompt_number": 60, "text": [ "" ] } ], "prompt_number": 60 } ], "metadata": {} } ] }