-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: repository in publish-ready state
- Loading branch information
1 parent
9471d33
commit 2811521
Showing
20 changed files
with
4,369 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Britton Hayes | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# 👩⚕️ Psych - Find a mental health professional | ||
|
||
Meet **Psych**, a Go application that allows you to find therapists from psychologytoday.com using a more powerful search engine. This tool provides various functionalities, including web scraping, browsing therapists in the terminal, and running a GraphQL API server to more effectively search for a therapist that meets your needs. | ||
|
||
<img src="https://raw.githubusercontent.com/ashleymcnamara/gophers/master/GOPHER_SHARE.png" alt="drawing" width="300"/> | ||
|
||
## Features | ||
|
||
- **Scraping:** Retrieve therapist information from psychologytoday.com based on various criteria such as state, county, city, or zip code. | ||
- **Browsing:** View therapist information in the terminal in a user-friendly interface. | ||
- **GraphQL API:** Run a GraphQL server to query therapist data programmatically. | ||
|
||
## Installation | ||
|
||
### Install with Go | ||
|
||
```bash | ||
go install github.com/brittonhayes/psych@latest | ||
``` | ||
|
||
## Usage | ||
|
||
Psych provides a set of commands to perform various tasks. Here's a brief overview: | ||
|
||
### Scrape | ||
|
||
Use the `scrape` command to retrieve therapist information from psychologytoday.com. | ||
|
||
```bash | ||
# Retrieve all therapists in the United States in your county | ||
psych scrape --state <state> --county <county> | ||
|
||
# Retrieve all therapists in your zip code | ||
psych scrape --zip <zip> | ||
|
||
# Retrieve all therapists in your city | ||
psych scrape --city <city> --state <state> | ||
``` | ||
|
||
Replace `<state>`, `<county>`, `<city>`, and `<zip>` with the desired criteria for searching therapists. | ||
|
||
### Browse | ||
|
||
Browse therapists in the terminal using the `browse` command. | ||
|
||
```bash | ||
psych browse | ||
``` | ||
|
||
### GraphQL API | ||
|
||
Run a GraphQL API server to query therapist data using the `api` command. | ||
|
||
```bash | ||
psych api --port <port> | ||
``` | ||
|
||
Replace `<port>` with the desired port number for the GraphQL server. | ||
|
||
### Additional Flags | ||
|
||
- Use `-v` or `--verbose` to enable verbose logging. | ||
- Use `-c` or `--config` to specify the configuration directory path. | ||
- Use `--db` to specify the path to the SQLite DB file. | ||
|
||
## Configuration | ||
|
||
Psych allows you to customize its behavior using command-line flags. You can also modify the application's source code to further customize its behavior according to your needs. | ||
|
||
## License | ||
|
||
This project is licensed under the [MIT License](LICENSE). | ||
|
||
--- | ||
|
||
Note:** This README provides a high-level overview of the `Psych` tool. For detailed usage instructions and examples, refer to the application's help documentation by running `psych --help` and `psych <command> --help`. | ||
|
||
*This project is not affiliated with or endorsed by psychologytoday.com.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# https://taskfile.dev | ||
|
||
version: '3' | ||
|
||
tasks: | ||
default: | ||
cmds: | ||
- task: install | ||
silent: true | ||
|
||
install: | ||
desc: Install psych tool | ||
cmds: | ||
- go install ./cmd/psych/ | ||
|
||
test: | ||
desc: Run tests | ||
cmds: | ||
- go test ./... | ||
silent: true | ||
|
||
gen: | ||
desc: Generate code | ||
cmds: | ||
- go generate ./... | ||
silent: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package api | ||
|
||
type Therapist struct { | ||
ID int `bun:"id,pk,autoincrement" json:"id"` | ||
Title string `json:"title"` | ||
Credentials string `json:"credentials"` | ||
Verified string `json:"verified"` | ||
Statement string `json:"statement"` | ||
Phone string `json:"phone"` | ||
Location string `json:"location"` | ||
Link string `json:"link"` | ||
} | ||
|
||
type GetTherapistParams struct { | ||
Title *string `json:"title"` | ||
Credentials *string `json:"credentials"` | ||
Verified *string `json:"verified"` | ||
Statement *string `json:"statement"` | ||
Phone *string `json:"phone"` | ||
Location *string `json:"location"` | ||
Link *string `json:"link"` | ||
Limit *int `json:"limit"` | ||
Offset *int `json:"offset"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.