Skip to content

Commit

Permalink
Replacing all occurrences of iPython with IPython (Fixes #43).
Browse files Browse the repository at this point in the history
  • Loading branch information
ptwobrussell committed Mar 30, 2013
1 parent 3f48b6a commit 728f297
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 78 deletions.
12 changes: 6 additions & 6 deletions ipython_notebooks/Chapter1.ipynb
Expand Up @@ -15,17 +15,17 @@
"\n", "\n",
"If you only have 10 seconds...\n", "If you only have 10 seconds...\n",
"\n", "\n",
"Twitter's new API will prevent you from running much of the code from _Mining the Social Web_, and this iPython Notebook shows you how to roll with the changes and adapt as painlessly as possible until an updated printing is available. In particular, it shows you how to authenticate before executing any API requests and demonstrates how to use the new search API.\n", "Twitter's new API will prevent you from running much of the code from _Mining the Social Web_, and this IPython Notebook shows you how to roll with the changes and adapt as painlessly as possible until an updated printing is available. In particular, it shows you how to authenticate before executing any API requests and demonstrates how to use the new search API.\n",
"\n", "\n",
"If you have a couple of minutes...\n", "If you have a couple of minutes...\n",
"\n", "\n",
"Twitter is officially retiring v1.0 of their API as of March 2013 with v1.1 of the API being the new status quo. There are a few fundamental differences that social web miners that should consider (see Twitter's blog at https://dev.twitter.com/blog/changes-coming-to-twitter-api and https://dev.twitter.com/docs/api/1.1/overview) with the two changes that are most likely to affect an existing workflow being that authentication is now mandatory for *all* requests, rate-limiting being on a per resource basis (as opposed to an overall rate limit based on a fixed number of requests per unit time), various platform objects changing (for the better), and search semantics changing to a \"pageless\" approach. All in all, the v1.1 API looks much cleaner and more consistent, and it should be a good thing longer-term although it may cause interim pains for folks migrating to it.\n", "Twitter is officially retiring v1.0 of their API as of March 2013 with v1.1 of the API being the new status quo. There are a few fundamental differences that social web miners that should consider (see Twitter's blog at https://dev.twitter.com/blog/changes-coming-to-twitter-api and https://dev.twitter.com/docs/api/1.1/overview) with the two changes that are most likely to affect an existing workflow being that authentication is now mandatory for *all* requests, rate-limiting being on a per resource basis (as opposed to an overall rate limit based on a fixed number of requests per unit time), various platform objects changing (for the better), and search semantics changing to a \"pageless\" approach. All in all, the v1.1 API looks much cleaner and more consistent, and it should be a good thing longer-term although it may cause interim pains for folks migrating to it.\n",
"\n", "\n",
"The latest printing of Mining the Social Web (2012-02-22, Third release) reflects v1.0 of the API, and this document is intended to provide readers with updated information and examples that specifically related to Twitter requests from Chapter 1 of the book until a new printing provides updates.\n", "The latest printing of Mining the Social Web (2012-02-22, Third release) reflects v1.0 of the API, and this document is intended to provide readers with updated information and examples that specifically related to Twitter requests from Chapter 1 of the book until a new printing provides updates.\n",
"\n", "\n",
"I've tried to add some filler in between the examples below so that they flow and are easy to follow along; however, they'll make a lot more sense to you if you are following along with the text. The great news is that you can download the sample chapter that corresponds to this iPython Notebook at http://shop.oreilly.com/product/0636920010203.do free of charge!\n", "I've tried to add some filler in between the examples below so that they flow and are easy to follow along; however, they'll make a lot more sense to you if you are following along with the text. The great news is that you can download the sample chapter that corresponds to this IPython Notebook at http://shop.oreilly.com/product/0636920010203.do free of charge!\n",
"\n", "\n",
"iPython Notebooks are also available for Chapters 4 and 5. As a reader of my book, I want you to know that I'm committed to helping you in any way that I can, so please reach out on Facebook at https://www.facebook.com/MiningTheSocialWeb or on Twitter at http://twitter.com/SocialWebMining if you have any questions or concerns in the meanwhile. I'd also love your feedback on whether or not you think that iPython Notebook is a good tool for tinkering with the source code for the book, because I'm strongly considering it as a supplement for each chapter.\n", "IPython Notebooks are also available for Chapters 4 and 5. As a reader of my book, I want you to know that I'm committed to helping you in any way that I can, so please reach out on Facebook at https://www.facebook.com/MiningTheSocialWeb or on Twitter at http://twitter.com/SocialWebMining if you have any questions or concerns in the meanwhile. I'd also love your feedback on whether or not you think that IPython Notebook is a good tool for tinkering with the source code for the book, because I'm strongly considering it as a supplement for each chapter.\n",
"\n", "\n",
"Regards - Matthew A. Russell" "Regards - Matthew A. Russell"
] ]
Expand Down Expand Up @@ -60,7 +60,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Once installed, you should be able to open up a Python interpreter (or better yet, your iPython interpreter) and get rolling. See http://ipython.org/ for more information on iPython if you're not already using it or viewing this file in iPython Notebook." "Once installed, you should be able to open up a Python interpreter (or better yet, your IPython interpreter) and get rolling. See http://ipython.org/ for more information on IPython if you're not already using it or viewing this file in IPython Notebook."
] ]
}, },
{ {
Expand Down Expand Up @@ -120,7 +120,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"iPython Notebook didn't display the output because the result of the API call was captured as a variable. Here's how you could print a readable version of the response." "IPython Notebook didn't display the output because the result of the API call was captured as a variable. Here's how you could print a readable version of the response."
] ]
}, },
{ {
Expand Down Expand Up @@ -190,7 +190,7 @@
"collapsed": false, "collapsed": false,
"input": [ "input": [
"import json\n", "import json\n",
"print json.dumps(statuses[0:2], indent=1) # Only print a couple of tweets here in iPython Notebook" "print json.dumps(statuses[0:2], indent=1) # Only print a couple of tweets here in IPython Notebook"
], ],
"language": "python", "language": "python",
"metadata": {}, "metadata": {},
Expand Down
12 changes: 6 additions & 6 deletions ipython_notebooks/Chapter1.py
Expand Up @@ -7,17 +7,17 @@
# #
# If you only have 10 seconds... # If you only have 10 seconds...
# #
# Twitter's new API will prevent you from running much of the code from _Mining the Social Web_, and this iPython Notebook shows you how to roll with the changes and adapt as painlessly as possible until an updated printing is available. In particular, it shows you how to authenticate before executing any API requests and demonstrates how to use the new search API. # Twitter's new API will prevent you from running much of the code from _Mining the Social Web_, and this IPython Notebook shows you how to roll with the changes and adapt as painlessly as possible until an updated printing is available. In particular, it shows you how to authenticate before executing any API requests and demonstrates how to use the new search API.
# #
# If you have a couple of minutes... # If you have a couple of minutes...
# #
# Twitter is officially retiring v1.0 of their API as of March 2013 with v1.1 of the API being the new status quo. There are a few fundamental differences that social web miners that should consider (see Twitter's blog at https://dev.twitter.com/blog/changes-coming-to-twitter-api and https://dev.twitter.com/docs/api/1.1/overview) with the two changes that are most likely to affect an existing workflow being that authentication is now mandatory for *all* requests, rate-limiting being on a per resource basis (as opposed to an overall rate limit based on a fixed number of requests per unit time), various platform objects changing (for the better), and search semantics changing to a "pageless" approach. All in all, the v1.1 API looks much cleaner and more consistent, and it should be a good thing longer-term although it may cause interim pains for folks migrating to it. # Twitter is officially retiring v1.0 of their API as of March 2013 with v1.1 of the API being the new status quo. There are a few fundamental differences that social web miners that should consider (see Twitter's blog at https://dev.twitter.com/blog/changes-coming-to-twitter-api and https://dev.twitter.com/docs/api/1.1/overview) with the two changes that are most likely to affect an existing workflow being that authentication is now mandatory for *all* requests, rate-limiting being on a per resource basis (as opposed to an overall rate limit based on a fixed number of requests per unit time), various platform objects changing (for the better), and search semantics changing to a "pageless" approach. All in all, the v1.1 API looks much cleaner and more consistent, and it should be a good thing longer-term although it may cause interim pains for folks migrating to it.
# #
# The latest printing of Mining the Social Web (2012-02-22, Third release) reflects v1.0 of the API, and this document is intended to provide readers with updated information and examples that specifically related to Twitter requests from Chapter 1 of the book until a new printing provides updates, which are likely to become available in the early April 2013 timeframe. (If you're an O'Reilly ebook customer, you'll get an updated version of the book automatically added to your account when the revisions are ready.) # The latest printing of Mining the Social Web (2012-02-22, Third release) reflects v1.0 of the API, and this document is intended to provide readers with updated information and examples that specifically related to Twitter requests from Chapter 1 of the book until a new printing provides updates, which are likely to become available in the early April 2013 timeframe. (If you're an O'Reilly ebook customer, you'll get an updated version of the book automatically added to your account when the revisions are ready.)
# #
# I've tried to add some filler in between the examples below so that they flow and are easy to follow along; however, they'll make a lot more sense to you if you are following along with the text. The great news is that you can download the sample chapter that corresponds to this iPython Notebook at http://shop.oreilly.com/product/0636920010203.do free of charge! # I've tried to add some filler in between the examples below so that they flow and are easy to follow along; however, they'll make a lot more sense to you if you are following along with the text. The great news is that you can download the sample chapter that corresponds to this IPython Notebook at http://shop.oreilly.com/product/0636920010203.do free of charge!
# #
# I'm working through updates to the sample source code for other Twitter-related content (Chapters 4 and 5) as quickly as possible and expect to have the GitHub repository updated by the end of March 2013. Thank you for your patience while I get this all sorted out. As a reader of my book, I want you to know that I'm committed to helping you in any way that I can, so please reach out on Facebook at https://www.facebook.com/MiningTheSocialWeb or on Twitter at http://twitter.com/SocialWebMining if you have any questions or concerns in the meanwhile. I'd also love your feedback on whether or not you think that iPython Notebook is a good tool for tinkering with the source code for the book, because I'm strongly considering it as a supplement for each chapter. # I'm working through updates to the sample source code for other Twitter-related content (Chapters 4 and 5) as quickly as possible and expect to have the GitHub repository updated by the end of March 2013. Thank you for your patience while I get this all sorted out. As a reader of my book, I want you to know that I'm committed to helping you in any way that I can, so please reach out on Facebook at https://www.facebook.com/MiningTheSocialWeb or on Twitter at http://twitter.com/SocialWebMining if you have any questions or concerns in the meanwhile. I'd also love your feedback on whether or not you think that IPython Notebook is a good tool for tinkering with the source code for the book, because I'm strongly considering it as a supplement for each chapter.
# #
# Regards - Matthew A. Russell # Regards - Matthew A. Russell


Expand All @@ -40,7 +40,7 @@


# <markdowncell> # <markdowncell>


# Once installed, you should be able to open up a Python interpreter (or better yet, your iPython interpreter) and get rolling. See http://ipython.org/ for more information on iPython if you're not already using it or viewing this file in iPython Notebook. # Once installed, you should be able to open up a Python interpreter (or better yet, your IPython interpreter) and get rolling. See http://ipython.org/ for more information on IPython if you're not already using it or viewing this file in IPython Notebook.


# <codecell> # <codecell>


Expand Down Expand Up @@ -82,7 +82,7 @@


# <markdowncell> # <markdowncell>


# iPython Notebook didn't display the output because the result of the API call was captured as a variable. Here's how you could print a readable version of the response. # IPython Notebook didn't display the output because the result of the API call was captured as a variable. Here's how you could print a readable version of the response.


# <codecell> # <codecell>


Expand Down Expand Up @@ -128,7 +128,7 @@
# <codecell> # <codecell>


import json import json
print json.dumps(statuses[0:2], indent=1) # Only print a couple of tweets here in iPython Notebook print json.dumps(statuses[0:2], indent=1) # Only print a couple of tweets here in IPython Notebook


# <markdowncell> # <markdowncell>


Expand Down
26 changes: 13 additions & 13 deletions ipython_notebooks/Chapter4.ipynb
Expand Up @@ -15,17 +15,17 @@
"\n", "\n",
"If you only have 10 seconds...\n", "If you only have 10 seconds...\n",
"\n", "\n",
"Twitter's new API will prevent you from running much of the code from _Mining the Social Web_, and this iPython Notebook shows you how to roll with the changes and adapt as painlessly as possible until an updated printing is available. In particular, it shows you how to authenticate before executing any API requests illustrated in this chapter. It is highly recommended that you read the iPython Notebook file for Chapter 1 before attempting the examples in this chapter if you haven't already.\n", "Twitter's new API will prevent you from running much of the code from _Mining the Social Web_, and this IPython Notebook shows you how to roll with the changes and adapt as painlessly as possible until an updated printing is available. In particular, it shows you how to authenticate before executing any API requests illustrated in this chapter. It is highly recommended that you read the IPython Notebook file for Chapter 1 before attempting the examples in this chapter if you haven't already.\n",
"\n", "\n",
"If you have a couple of minutes...\n", "If you have a couple of minutes...\n",
"\n", "\n",
"Twitter is officially retiring v1.0 of their API as of March 2013 with v1.1 of the API being the new status quo. There are a few fundamental differences that social web miners that should consider (see Twitter's blog at https://dev.twitter.com/blog/changes-coming-to-twitter-api and https://dev.twitter.com/docs/api/1.1/overview) with the two changes that are most likely to affect an existing workflow being that authentication is now mandatory for *all* requests, rate-limiting being on a per resource basis (as opposed to an overall rate limit based on a fixed number of requests per unit time), various platform objects changing (for the better), and search semantics changing to a \"pageless\" approach. All in all, the v1.1 API looks much cleaner and more consistent, and it should be a good thing longer-term although it may cause interim pains for folks migrating to it.\n", "Twitter is officially retiring v1.0 of their API as of March 2013 with v1.1 of the API being the new status quo. There are a few fundamental differences that social web miners that should consider (see Twitter's blog at https://dev.twitter.com/blog/changes-coming-to-twitter-api and https://dev.twitter.com/docs/api/1.1/overview) with the two changes that are most likely to affect an existing workflow being that authentication is now mandatory for *all* requests, rate-limiting being on a per resource basis (as opposed to an overall rate limit based on a fixed number of requests per unit time), various platform objects changing (for the better), and search semantics changing to a \"pageless\" approach. All in all, the v1.1 API looks much cleaner and more consistent, and it should be a good thing longer-term although it may cause interim pains for folks migrating to it.\n",
"\n", "\n",
"The latest printing of Mining the Social Web (2012-02-22, Third release) reflects v1.0 of the API, and this document is intended to provide readers with updated examples from Chapter 4 of the book until a new printing provides updates.\n", "The latest printing of Mining the Social Web (2012-02-22, Third release) reflects v1.0 of the API, and this document is intended to provide readers with updated examples from Chapter 4 of the book until a new printing provides updates.\n",
"\n", "\n",
"Unlike the iPython Notebook for Chapter 1, there is no filler in this notebook at this time. See the Chapter 1 notebook for a good introduction to using the Twitter API and all that it entails.\n", "Unlike the IPython Notebook for Chapter 1, there is no filler in this notebook at this time. See the Chapter 1 notebook for a good introduction to using the Twitter API and all that it entails.\n",
"\n", "\n",
"As a reader of my book, I want you to know that I'm committed to helping you in any way that I can, so please reach out on Facebook at https://www.facebook.com/MiningTheSocialWeb or on Twitter at http://twitter.com/SocialWebMining if you have any questions or concerns in the meanwhile. I'd also love your feedback on whether or not you think that iPython Notebook is a good tool for tinkering with the source code for the book, because I'm strongly considering it as a supplement for each chapter.\n", "As a reader of my book, I want you to know that I'm committed to helping you in any way that I can, so please reach out on Facebook at https://www.facebook.com/MiningTheSocialWeb or on Twitter at http://twitter.com/SocialWebMining if you have any questions or concerns in the meanwhile. I'd also love your feedback on whether or not you think that IPython Notebook is a good tool for tinkering with the source code for the book, because I'm strongly considering it as a supplement for each chapter.\n",
"\n", "\n",
"Regards - Matthew A. Russell\n", "Regards - Matthew A. Russell\n",
"\n", "\n",
Expand Down Expand Up @@ -100,7 +100,7 @@
"import cPickle\n", "import cPickle\n",
"import twitter\n", "import twitter\n",
"\n", "\n",
"SCREEN_NAME = 'timoreilly' # XXX: iPython Notebook cannot prompt for input\n", "SCREEN_NAME = 'timoreilly' # XXX: IPython Notebook cannot prompt for input\n",
"\n", "\n",
"friends_limit = 10000\n", "friends_limit = 10000\n",
"\n", "\n",
Expand Down Expand Up @@ -173,8 +173,8 @@
"import twitter\n", "import twitter\n",
"from twitter__util import makeTwitterRequest \n", "from twitter__util import makeTwitterRequest \n",
"\n", "\n",
"SCREEN_NAME = 'timoreilly' # XXX: iPython Notebook cannot prompt for input\n", "SCREEN_NAME = 'timoreilly' # XXX: IPython Notebook cannot prompt for input\n",
"FRIENDS_LIMIT = 10000 # XXX: iPython Notebook cannot prompt for input\n", "FRIENDS_LIMIT = 10000 # XXX: IPython Notebook cannot prompt for input\n",
"\n", "\n",
"def getFriendIds(screen_name=None, user_id=None, friends_limit=10000):\n", "def getFriendIds(screen_name=None, user_id=None, friends_limit=10000):\n",
"\n", "\n",
Expand Down Expand Up @@ -236,7 +236,7 @@
"# Creates a consistent key value for a user given a screen name\n", "# Creates a consistent key value for a user given a screen name\n",
"from twitter__util import getRedisIdByScreenName\n", "from twitter__util import getRedisIdByScreenName\n",
"\n", "\n",
"SCREEN_NAME = 'timoreilly' # XXX: iPython Notebook cannot prompt for input\n", "SCREEN_NAME = 'timoreilly' # XXX: IPython Notebook cannot prompt for input\n",
"\n", "\n",
"MAXINT = 10000 #sys.maxint\n", "MAXINT = 10000 #sys.maxint\n",
"\n", "\n",
Expand Down Expand Up @@ -328,7 +328,7 @@
"from twitter__util import getUserInfo\n", "from twitter__util import getUserInfo\n",
"\n", "\n",
"if __name__ == \"__main__\":\n", "if __name__ == \"__main__\":\n",
" # XXX: iPython Notebook cannot prompt for input\n", " # XXX: IPython Notebook cannot prompt for input\n",
" screen_names = ['timoreilly', 'socialwebmining', 'ptwobrussell']\n", " screen_names = ['timoreilly', 'socialwebmining', 'ptwobrussell']\n",
"\n", "\n",
" r = redis.Redis()\n", " r = redis.Redis()\n",
Expand Down Expand Up @@ -390,7 +390,7 @@
"# supplying have already been added to Redis.\n", "# supplying have already been added to Redis.\n",
"# See friends_followers__get_friends__refactored.py (Example 4-3)\n", "# See friends_followers__get_friends__refactored.py (Example 4-3)\n",
"\n", "\n",
"# XXX: iPython Notebook cannot prompt for input\n", "# XXX: IPython Notebook cannot prompt for input\n",
"friendsFollowersInCommon(['timoreilly', 'socialwebmining'])" "friendsFollowersInCommon(['timoreilly', 'socialwebmining'])"
], ],
"language": "python", "language": "python",
Expand All @@ -414,7 +414,7 @@
"from twitter__util import getUserInfo\n", "from twitter__util import getUserInfo\n",
"from twitter__util import _getFriendsOrFollowersUsingFunc\n", "from twitter__util import _getFriendsOrFollowersUsingFunc\n",
"\n", "\n",
"SCREEN_NAME = 'timoreilly' # XXX: iPython Notebook cannot prompt for input\n", "SCREEN_NAME = 'timoreilly' # XXX: IPython Notebook cannot prompt for input\n",
"\n", "\n",
"r = redis.Redis()\n", "r = redis.Redis()\n",
"\n", "\n",
Expand Down Expand Up @@ -499,7 +499,7 @@
"from twitter__util import getRedisIdByScreenName \n", "from twitter__util import getRedisIdByScreenName \n",
"from twitter__util import getRedisIdByUserId\n", "from twitter__util import getRedisIdByUserId\n",
"\n", "\n",
"SCREEN_NAME = 'timoreilly' # XXX: iPython Notebook cannot prompt for input\n", "SCREEN_NAME = 'timoreilly' # XXX: IPython Notebook cannot prompt for input\n",
"\n", "\n",
"locale.setlocale(locale.LC_ALL, '')\n", "locale.setlocale(locale.LC_ALL, '')\n",
"\n", "\n",
Expand Down Expand Up @@ -576,7 +576,7 @@
"from twitter__util import getRedisIdByScreenName\n", "from twitter__util import getRedisIdByScreenName\n",
"from twitter__util import getRedisIdByUserId\n", "from twitter__util import getRedisIdByUserId\n",
"\n", "\n",
"SCREEN_NAME = 'timoreilly' # XXX: iPython Notebook cannot prompt for input\n", "SCREEN_NAME = 'timoreilly' # XXX: IPython Notebook cannot prompt for input\n",
"\n", "\n",
"g = nx.Graph()\n", "g = nx.Graph()\n",
"r = redis.Redis()\n", "r = redis.Redis()\n",
Expand Down Expand Up @@ -648,7 +648,7 @@
"import json\n", "import json\n",
"import networkx as nx\n", "import networkx as nx\n",
"\n", "\n",
"G = 'out/timoreilly.gpickle' # iPython Notebook cannot prompt for input\n", "G = 'out/timoreilly.gpickle' # IPython Notebook cannot prompt for input\n",
"\n", "\n",
"g = nx.read_gpickle(G)\n", "g = nx.read_gpickle(G)\n",
"\n", "\n",
Expand Down

0 comments on commit 728f297

Please sign in to comment.