Git Product home page Git Product logo

hiringagency's Introduction

Hiring (re)Agency

My Javascript/mxWeb™ "AskHN: Who Is Hiring" browser ported to CLJS/Reagent. Search and annotate the hundreds of jobs listed every month.

On the IPhone Sim

If yer just lookin' for work, the JS version is live here grace a GitHub. Or you can clone this and run it yourself. See below for a devops necessity.

Development Mode

Grab HN Pages

The app runs off pages curl'ed straight from the HN server. So they get out of date (but see below for the script I created to run indefinitely at a specified interval to refresh them).

To grab a page we need the message ID of the actual "Who is hiring" question. We start by visiting HN and tracking down the "Who Is Hiring?" question under AskHN. Here is June, 2018. Now checkout the browser URL:

https://news.ycombinator.com/item?id=17205865

The browser app lives and breathes that 17205865.

Now we want to pull 1-N pages under that ID because, when the list gets big, HN breaks up the page into multiple pages keyed by a simple p parameter. Here is what we curl to get page 2:

https://news.ycombinator.com/item?id=17205865&p=2

To automate page grabbing I cobbled together a neophyte's bash script we invoke like this (but read on for important prior steps):

cd rehiring
./grab 17205865

An optional second parameter tells the script to wait that many minutes and refresh, until control-C'ed.

I mentioned a prior step. There is no way to know how many pages to scrape, but there is no harm other than wasted bandwidth in guessing high: ;f we curl too high a p (by setting MAX_P too high) we just get the last. So I edit the grab shell script and look for:

MAX_P=3

...and tweak the 3 (or whatever). Now edit index.html and look for this:

    <script>
    var gMonthlies = [
        { hnId: "17205865", desc: "June, 2018", pgCount: 1}
        , { hnId: "16967543", desc: "May, 2018", pgCount: 6}
        , { hnId: "16735011", desc: "April, 2018", pgCount: 5}
    ]
    rehiring.core.init();
   </script>

Edit reasonably. The one mistake you can make (blame IFRAME!) is having a pgCount higher than the number of pages available: the app will wait for all pages to load but the extras of course will not load and using a JS timer to decide when to give up is left as an exercise. (No, IFRAMEs offer no error to work from if a URL would normally 404.)

Now your copy of the app should work with any new content you specify in index.html.

Run application:

lein clean
lein figwheel

Figwheel will automatically push cljs changes to the browser.

Wait a bit, then browse to http://localhost:3449.

Contact @maverick on Slack #Clojurians or raise an issue here if you have problems, question, or comments.

hiringagency's People

Contributors

kennytilton avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.