Skip to content

Commit

Permalink
docs: update README per #135
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan-Zollinger committed Jun 19, 2024
1 parent 91071ee commit b4ef7a7
Showing 1 changed file with 24 additions and 44 deletions.
68 changes: 24 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,72 +39,48 @@

## Summary

Threshr is a wrapper library for Target Corporation's redsky api. The redsky api has endpoints for querying product and store information. This includes fulfillment options, pricing, vendors, etc.
Threshr is a wrapper library for various grocery store api's. This includes querying specific store pricing and product data.

### Projects using threshr

Other projects using threshr include other graqr projects like the [threshr cli] and [harvester]

## Install

This project's artifacts are hosted on GitHub. Follow [these instructions] in order to include threshr in your maven or
gradle projects.
<ul>
<details><summary>My summary of GitHub's Instructions</summary>
<ol>
At the time of writing this, GitHub doesn't support using GitHub-hosted artifacts without first authenticating. You can do this in two steps:
<li>Generate a personal access token with <code>read:packages</code> <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token">privileges</a>. </li>
<li>Add <code><a href="settings.xml">settings.xml</a></code> to your <code>~/.m2/</code> directory (swapping Batman's name and password for your GitHub user and the token from step 1</li>
</ol>
</details>
</ul>
Threshr is available to jvm projects via [maven central].

<details><summary>Maven</summary>

#### Include as a Maven Dependency
```xml
<dependency>
<groupId>com.graqr</groupId>
<artifactId>threshr</artifactId>
<version>0.0.12</version>
</dependency>
```
#### Include as a Gradle dependency
```groovy
compile "com.graqr:threshr:0.0.12"
```

#### Environment Variables

You'll need to add api `key` and `CHANNEL` values to environment variables `THRESHR_KEY` and `THRESHR_CHANNEL`. I like using a `.env` file like the one below.
```properties
THRESHR_KEY=BatKey
THRESHR_CHANNEL=WEB
```
> :warning: Environment Variables on windows must be assigned as an environment variable, ie `$env:foo`.
<details><summary id="api-key">How to find a key for the redsky api</summary><ul>

In the network tab in your browser's dev tools, search for any endpoints from the `redsky.target.com` domain. Below I'm in firefox, from whose context menu I'm given the option to copy an api call's parameters.
</details>

![redsky_network-tab_firefox.gif](media%2Fredsky_network-tab_firefox.gif)
</ul></details>
<details><summary>Gradle</summary>

## Usage
```groovy
implementation group: 'com.graqr', name: 'threshr', version: '0.0.12'
```
</details>

Threshr doesn't support all redsky endpoints (not yet). There are three endpoints currently supported:
<details><summary>Gradle Kotlin</summary>

```java
List<ProductSummary> fetchProductSummaries(TargetStore targetStore, Tcin tcin);
List<ProductSummary> fetchProductSummaries(TargetStore targetStore, String... tcin) throws ThreshrException;
```
```java
Product fetchProductDetails(TargetStore targetStore, String tcin);
```
```java
NearbyStores queryStoreLocations(Place place); // default values for limit and within
NearbyStores queryStoreLocations(int limit, int within, Place place);
```kotlin
implementation("com.graqr:threshr:0.0.12")
```
</details>

___
> [!NOTE]
> See the [testing README] for more information about all the needed environment variables, as well as tips and best practices.
### Want to get involved?

See our [contributing] doc before taking a whack at any [open issues]. Also be sure to read the [Testing README](src/test/groovy/com/graqr/threshr/README.md) for some tips and tricks. We'd love for you to work with us!
See our [contributing] doc before taking a whack at any [open issues]. Also be sure to read the [testing README] for some tips and tricks. We'd love for you to work with us!

<!--top bar-->
[Bugs]:https://sonarcloud.io/api/project_badges/measure?project=Graqr_Threshr&metric=bugs
Expand Down Expand Up @@ -144,3 +120,7 @@ See our [contributing] doc before taking a whack at any [open issues]. Also be s

<!--All the other links-->
[these instructions]:https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry
[testing README]:src\test\groovy\com\graqr\threshr\README.md
[maven central]:https://central.sonatype.com/artifact/com.graqr/threshr/overview
[threshr cli]:https://github.com/Graqr/threshr-cli
[harvester]:https://github.com/Graqr/Harvester

0 comments on commit b4ef7a7

Please sign in to comment.