Skip to content
Mike Lissner edited this page Aug 8, 2014 · 2 revisions

Juriscraper on OSX in 10 Easy Steps

  • These instructions assume you have pip as an instal manager
  • You will also want to install iPython to test your code against the sample scraper

--- Let s get your virtual BitBucket account and personal Juriscraper repo setup first ---

1 - Use your favorite browser to set up a BitBucket account: https://bitbucket.org/

  • Login
  • Confirm your email

2 - On the BitBucket site, fork Mlissner s Juriscraper repo to your account: https://bitbucket.org/mlissner/juriscraper

--- Now we re going to get BitBucket / Mercurial set up on your computer ---

3 - Download and follow the instal instructions for Mercurial: http://mercurial.selenic.com/

--- Open a fresh Terminal window ---

4 - Configure Mercurial by creating a config file that should work for all your Mercurial repos using vim - Be sure to use the email and username you used to create your BitBucket account

   $ vim ~/.hgrc
   (use  i  to enter text)

   [ui]
   username = yourUsername <email@account.com>
   merge = meld
   
   [auth]
   bb.prefix = http://bitbucket.org/yourUsername/
   bb.username = yourUsername
   bb.password = yourPassword

   [merge-tools]
   meld-args = $base $local $other
   
- Use esc and then   :wq    to escape vim

5 - Create a folder / directory where you want to save all your Juriscraper work
- The project is about 22 MB in size - Navigate to where you want the file using $ ls and $ cd, then $ mkdir Repositories

6 - Navigate (cd into) to your new Repositories directory and clone your virtual BitBucket Juriscraper repo to your local computer. - Reminder: Unlike GitHub, Mercurial uses hg not git at the beginning of all it s commands. Otherwise it s almost exactly the same $ hg clone https://yourUsername@bitbucket.org/yourUsername/juriscraper

7 - Install juriscraper dependencies $ sudo pip install libxml2-dev libxslt-devel $ sudo pip install chardet==1.0.1 $ sudo pip install requests==1.2.3 $ sudo pip install lxml==3.0.1 $ sudo mkdir /var/log/juriscraper/

8 - Get started! Navigate to where the state scrapers are saved. $ cd juriscraper/opinions/united_states - Open a state scraper file in your favorite text editor (here I m using Sublime Text ). $ open -a Sublime\ Text stateName.py 9 - Edit away. Save your work. Return to your juriscraper repo in your Terminal window to submit your code for review. $ hg status - You should see a little M next to the file you ve been working on) $ hg commit -m "your commit message here" stateName.py -You ll be asked to enter your BitBucket account password) $ hg push

--- Re-open your browser and login to your BitBucket account ---

10 - Go to your online BitBucket account in your browser and confirm your changes have been uploaded correctly by clicking on the Commits tab. If your edits are in order (look for the Compare options), submit a Pull Request to the original mlissner/juriscraper repo (look for the button in the upper right). The more detail you can leave in the comments section the better.

  • Celebrate! Your code will be reviewed by the FreeLaw Team.
Clone this wiki locally