Skip to content

Commit

Permalink
Refactor git-hire.clj script and update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
simonneutert committed Jan 6, 2024
1 parent 2c55918 commit bfb8598
Show file tree
Hide file tree
Showing 7 changed files with 284 additions and 118 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
java microsoft-21.0.1
babashka 1.0.170
babashka 1.3.186
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"editor.formatOnSave": true
}
"editor.formatOnSave": true
}
36 changes: 13 additions & 23 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
# git hire! hire on 🔥!

---

## 🚨 Bug with newer babashka versions!<!-- omit in toc -->

**babashka 1.0.170** is the latest working version with this code.

I hope to be working on the bug in early 2024 🤞
The PR is here: [#2](https://github.com/simonneutert/git-hire/pull/2)

🩹⛑️ What I could quickly come up with is a super simple `Dockerfile`.
This way you can run it in a container, with the correct version of babashka pinned.
For those needing help with Docker, I will add a section below very soon. Please be patient 🙏

---

Ever wondered who is coding what in your city and how to keep track of it, maybe `grep` projects by keyword?

This is your tool! (babashka V1.0.170 mandatory)

![this is fine dog](https://i.kym-cdn.com/entries/icons/mobile/000/018/012/this_is_fine.jpg)
https://knowyourmeme.com/memes/this-is-fine

## A word of warning regarding the current/newest version (main branch) 🧯

I merged https://github.com/simonneutert/git-hire/pull/2 in, which requires the minimal babashka version to be `1.1.171` from now on.
I couldn't test the software very thoroughly, but it should work. 🤞

## Features

- [x] up to 1000 users per city + language combination (sorted by "users' public repositories count")
Expand Down Expand Up @@ -57,15 +47,15 @@ or have it in your `.zshrc` 🤗 or whatever your shell loads at start

### Download profiles

`$ bb git-hire.clj <location-like-city-or-country>`
`$ bb scrape <location-like-city-or-country>`

Will save the github profiles as `.edn` into the `profiles` directory,
**but** as GitHub support let me know:
> When using the language qualifier when searching for users, it will only return users where the majority of their repositories use the specified language. (please, see [documentation](https://docs.github.com/en/search-github/searching-on-github/searching-users#search-by-repository-language))
Specify further adding a language:

`$ bb git-hire.clj <location-like-city-or-country> <language>`
`$ bb scrape <location-like-city-or-country> <language>`

**Be warned!** This might not find a PHP dev who switched to Rust recently, as described by GitHub's Support.

Expand All @@ -77,11 +67,11 @@ After having built a pool of profiles, use

#### examples

`$ bb git-hire.clj mainz`
`$ bb git-hire.clj "Bad Schwalbach"`
`$ bb git-hire.clj wiesbaden java`
`$ bb git-hire.clj wiesbaden php`
`$ bb git-hire.clj mainz javascript`
`$ bb scrape mainz`
`$ bb scrape "Bad Schwalbach"`
`$ bb scrape wiesbaden java`
`$ bb scrape wiesbaden php`
`$ bb scrape mainz javascript`

### Search in result files (saved profiles)

Expand Down Expand Up @@ -177,7 +167,7 @@ Some stuff you would want to know/read as a beginner.

`pmap` and `curl` don't play well with each other in the shell (I guess).
Don't worry, run the tool from the shell:
`bb git-hire.clj berlin ruby`
`bb scrape berlin ruby`
it will fire up some threads 🔥

### CookBook Babashka
Expand Down
10 changes: 7 additions & 3 deletions bb.edn
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{:tasks
{:paths ["src"]
:min-bb-version "1.1.171"
:tasks
{:requires ([babashka.fs :as fs]
[babashka.process :refer [process]]
[clojure.string :as str]
[clojure.edn :as edn])
scrape {:doc " Scrape all items from a user's profile "
:task git-hire.main/-main}
search-keyword (let [search (first *command-line-args*)]
(->
(str "grep -r -i -l " search " profiles")
(str " grep -r -i -l " search " profiles ")
(babashka.process/process)
:out slurp str/split-lines clojure.pprint/pprint))}}
:out slurp str/split-lines clojure.pprint/pprint))}} "
Loading

0 comments on commit bfb8598

Please sign in to comment.