{ "cells": [ { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import praw\n", "import redditDataset\n", "r = praw.Reddit(user_agent='get_comments')" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Current subreddit: learn programming\n", "Current post: Want to learn basic unix cmds? Learn it interactively with 'interactive-shell' script\n", "[u'ellisgeek', u'tempacct111', u'luikraken', u'ellisgeek', u'Johannes_Joestar', u'hdsdi', u'why_not_start_over', u'drifteresque', u'linuxlearningnewbie', u'Whoops-a-Daisy']\n", "Current post: [help] webscraping/xpath\n", "[u'michaelkepler', u'silvv', u'michaelkepler', u'silvv', u'michaelkepler', u'silvv', u'michaelkepler', u'silvv', u'michaelkepler', u'ReverseEngineerFox']\n", "Current post: I want to try to change the cloud to butt chrome extension a little but I'm not even 100% sure what the language is.\n", "[u'pacificmint', u'solid7', u'mr-fahrenheit_']\n", "Current post: C: Elements in an array formula explanation please\n", "[u'zifyoip', u'Deciama']\n", "Current post: [Ruby] My code works well on Sublime but CodeWars keeps returning an error\n", "[u'rcuhljr', u'1-800-XXX-XXXX', u'pmbotter', u'Egomaniacal_Pain']\n", "Current post: [c#] why doesn't this exist in current context?\n", "[u'deltageek', u'icebbyice', u'CNotSoSharp', u'icebbyice']\n", "Current post: How should I learn MEAN?\n", "[u'MadCapitalist', u'jhartikainen', u'Rodion91']\n", "Current post: [Java] Is there a way to test if an index of an int array has only been initialized by Java?\n", "[u'desrtfx', u'XunOnline', u'desrtfx', u'XunOnline', u'desrtfx', u'Windex007', u'XunOnline', u'wgormley', u'XunOnline', u'wgormley']\n", "Current post: [Java] can I set an int variable to more than one value?\n", "[u'zifyoip', u'nixon_richard_m', u'Magixxxx', u'cmekss', u'nixon_richard_m', u'Magixxxx', u'nixon_richard_m', u'desrtfx', u'rill2503456', u'mathen', u'eyePlus', u'rawrrang']\n", "Current post: Consuming twitter's streaming API in real time?\n", "[u'arbostek', u'sindbis', u'arbostek', u'sindbis', u'arbostek', u'ShadyCupcake']\n", "Current post: C# vs Go\n", "[u'lightcloud5', u'solid7', u'voidvector', u'butlerccreltub']\n", "Current post: Whats a good simple programming language to make a text base adventure game? Where could i learn it?\n", "[u'desrtfx', u'Splurge-Master', u'desrtfx']\n", "Current post: Trying to make a home web server using Apache Tomcat. I also just bought a Domain Name now how do I connect my webapp so it may be accesible publicly on the internet? Please help :)\n", "[u'corpsmoderne', u'RustyJar', u'heroOfTimeBitch', u'newaccount1236', u'heroOfTimeBitch', u'wolfcry0', u'BradChesney79', u'heroOfTimeBitch', u'BradChesney79']\n", "Current post: [.VB] Problem with strings and arrays\n", "[u'desrtfx', u'beestar95', u'desrtfx', u'beestar95']\n", "Current post: One object, many matching patterns\n", "[u'jrandm']\n", "Current post: What's a *good* programming language?\n", "[u'thoosequa', u'brainard52', u'ethergreen', u'the_omega99']\n", "Current post: [Web Development] Ruby vs Python vs PHP\n", "[u'RodionGork', u'mikeful92', u'fresh_prince_', u'vonnKlaus', u'jrandm', u'New_Document_37', u'farmerje', u'albertonreddit', u'dmazzoni', u'dmazzoni', u'Durzan666']\n", "Current post: Help! I don't understand flow of program [Assembly]\n", "[u'missblit']\n", "Current post: Frustrated with my programming skills. I've been thinking about quitting.\n", "[u'lightcloud5', u'projectpolak', u'ethergreen', u'rawrrang', u'darkraven418']\n", "Current post: [C][Short]Get current terminal path\n", "[u'zifyoip', u'kluuuuup', u'reddilada', u'kluuuuup']\n", "Current post: C++ SDL2 Game Programming Tutorial!\n", "[u'thoosequa', u'rekreantCS', u'thoosequa', u'rekreantCS', u'thoosequa', u'rekreantCS', u'thoosequa', u'rekreantCS']\n", "Current post: [C] - Problem\n", "[u'green_griffon', u'desintrinski', u'desintrinski', u'green_griffon', u'desintrinski', u'arbostek', u'desintrinski', u'arbostek', u'desintrinski', u'arbostek', u'desintrinski', u'enfrozt', u'desintrinski']\n", "Current post: How big do my changes need to be to warrant a git commit?\n", "[u'ponyoink', u'glemnar', u'jhartikainen', u'shloaner']\n", "Current post: Object oriented PHP vs procedural PHP?\n", "[u'yuogzer', u'ToBadForU', u'MrPopinjay', u'praesartus']\n", "Current post: C# using bool IsPrime\n", "[u'zifyoip', u'No_Smoking', u'langfod', u'ethergreen', u'lightcloud5']\n", "Current post: First Open source contribution and licenses\n", "[u'ianhedoesit', u'freezkyd']\n", "Current post: [Oracle] One to One Relationship coding questions\n", "[u'lightcloud5', u'IIoWoII', u'AgentCain']\n", "Current post: What books would you recommend to learn c# or python?\n", "[u'Noxia']\n", "Current post: Can I remove # Options +FollowSymLinks from the htaccess if I do page by page 301 redirects?\n", "[]\n", "Current post: Should i learn anything else before Swift?\n", "[u'YvesSoete']\n", "Current post: Streaming C# coding tutorials and stuff\n", "[]\n", "Current post: [Google script] \"Cannot convert Range to (class)\" error when using .getRange(row, numRows, column, numColumns)\n", "[]\n", "Current post: Split a string by empty entries\n", "[u'the_omega99']\n", "Current post: [PHP, Ruby, or other] Parsing text of website and displaying it on on my local homepage - language and getting started question\n", "[u'jrandm']\n", "Current post: What factors do Python developers consider when choosing which implementation to use?\n", "[u'ethergreen']\n", "Current post: [Java] Pulling integers from a string\n", "[u'G01denW01f11', u'ethergreen']\n", "Current post: [Homework][VB.NET] Do..Loop to find the occurrence of the word.\n", "[u'DarkWolfPtyLtd']\n", "Current post: Topics for Semester Project\n", "[]\n", "Current post: [C#] Fast 'closest point to another point' search? I think this has something to do with Oct trees but struggling to figure it out.\n", "[u'ethergreen']\n", "Current subreddit: Datasets Archive\n", "Current post: Open data about crime and policing in England, Wales and Northern Ireland\n", "[u'MyKungFuIsCat', u'cavedave']\n", "Current post: Every space launch (x-post from r/space)\n", "[]\n" ] } ], "source": [ "\"\"\"\n", "Old version of createDataset which just prints output\n", "\"\"\"\n", "\n", "reload(redditDataset)\n", "subreddits = redditDataset.getSubreddits(r, ['learnprogramming', 'datasets'])\n", "redditDataset.createDataset(r, subreddits, dateRange='hour', nCommentsPerSubmission=20)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "\"\"\"\n", "Testing out tables \n", "\"\"\" \n", "reload(redditDataset)\n", "c = initializeDatabase()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.9" } }, "nbformat": 4, "nbformat_minor": 0 }