Skip to content

Commit

Permalink
Release 1.5.0
Browse files Browse the repository at this point in the history
Release 1.5.0

CI Causing issues
  • Loading branch information
jack-mil authored Feb 11, 2023
2 parents cd4051b + fb16b3f commit 7f39eed
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 23 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,17 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel
- if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
run: python .ci/prep_version.py VERSION --develop --inplace
run: python .ci/prep_version.py bing_rewards/VERSION --develop --inplace
- if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: python .ci/prep_version.py VERSION --master --inplace
run: python .ci/prep_version.py bing_rewards/VERSION --master --inplace
- if: ${{ github.event_name == 'pull_request' && github.base_ref == 'develop' }}
run: python .ci/prep_version.py VERSION --dev-pr --inplace
run: python .ci/prep_version.py bing_rewards/VERSION --dev-pr --inplace
- if: ${{ github.event_name == 'pull_request' && github.base_ref == 'master' }}
run: python .ci/prep_version.py VERSION --staging --inplace
run: python .ci/prep_version.py bing_rewards/VERSION --staging --inplace
- name: Build Package
run: |
python setup.py sdist bdist_wheel
python setup.py sdist
pip wheel --no-deps -w dist .
- name: Save Artifacts
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -118,7 +119,7 @@ jobs:
git config user.email "<[email protected]>"
- name: Get Tag Version
run: |
echo "version=v$(cat VERSION)" >> $GITHUB_ENV
echo "version=v$(cat bing_rewards/VERSION)" >> $GITHUB_ENV
- name: Create Github Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
Expand All @@ -132,7 +133,7 @@ jobs:
run: |
git checkout develop
git merge origin/master --no-ff
python .ci/bump_version.py VERSION --minor --inplace
git add VERSION
git commit -m "[skip ci] Bump version to $(cat VERSION)"
python .ci/bump_version.py bing_rewards/VERSION --minor --inplace
git add bing_rewards/VERSION
git commit -m "[skip ci] Bump version to $(cat bing_rewards/VERSION)"
git push origin develop
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
### A script to automate daily Bing rewards points
Please submit an issue or pull-request if you have an idea for a feature

#### :exclamation: NOTE: The user agent spoofing seems to have stopped working when using Microsoft Edge browser. Currently investigating if this is a breaking change on their side (See issue [#13](https://github.com/jack-mil/bing-rewards/issues/13)). For the time being, Brave and Chrome seem to work fine.
#### :exclamation: NOTE: Compatibilty with browsers seems hit and miss. I have confirmed intended behavoir using Brave 1.48.158 (Chromium 110.0.5481.77) on Windows 10 Pro. It's worth trying out several Chromium based browsers to see what works best for you (see `--exe` flag or config file)
#### UPDATE 1.5.0: It appears that the bonus points from using a mobile device is no longer a feature. My rewards page only lists 50 points from searching, and 5 bonus points for the Edge Browser. As such, running with the `--mobile` flag is unnecessary. I have also modifed the default search count and run action to match the recent changes to the rewards system.

## **Features:**

Expand All @@ -24,16 +25,22 @@ Please submit an issue or pull-request if you have an idea for a feature
* All files are local, makes no http(s) requests
* Only one external dependance (PyAutoGUI)
* Fine tune delay and set browser executable with config at $XDG_CONFIG_HOME or %APPDATA% on Windows
* Best Value: gift cards: **1,050 points / $1** (current rate)
***

## **Install with Pip!**
## **Install from PyPI!**

```bash
pip install bing-rewards
```
Will make the executable `bing-rewards` available on your PATH.
Look below or try the `--help` flag to see detailed usage.

**Recommended**: Use a virtual environment or [`pipx`](https://pypa.github.io/pipx/) to avoid poluting your global package path with executable apps. See: [pipx](https://pypa.github.io/pipx/)
```bash
pipx install bing-rewards
```

## **Requirements:**

- At least Python 3.6.
Expand All @@ -42,7 +49,7 @@ Look below or try the `--help` flag to see detailed usage.
WARNING: This script *will* take control away from the keyboard while running. PyAutoGUI performs key presses. i.e., it does not operate headless or in the background.

- `chrome` must be discoverable on the system PATH. [Download Google Chrome](https://www.google.com/intl/en/chrome/).
If you use a different chromium based browser that supports setting user agents via the `--user-agent` option (tested with Brave), you can use the `--exe` flag with an absolute path to the browser executable to use.
If you use a different chromium based browser that supports setting user agents via the `--user-agent` option (tested with Brave), you can use the `--exe` flag with an absolute path to the browser executable to use. Also see the `"browser-path"` key in the config file.

- To earn points from searching, you must also have logged into [bing.com](https://www.bing.com) with your Microsoft account at least once, to save cookies.

Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

1 change: 1 addition & 0 deletions bing_rewards/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.5.0
20 changes: 13 additions & 7 deletions bing_rewards/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Bing Search
v1.4.0
{VERSION}
Automatically perform Bing searches for Rewards Points!
Executing 'bing-rewards' with no arguments does {DESKTOP_COUNT} desktop searches
followed by {MOBILE_COUNT} mobile searches by default
Expand Down Expand Up @@ -58,8 +58,8 @@


# Number of searches to make
DESKTOP_COUNT = 34
MOBILE_COUNT = 40
DESKTOP_COUNT = 50
MOBILE_COUNT = 0

# Time to allow Chrome to load in seconds
LOAD_DELAY = 1.5
Expand All @@ -84,6 +84,10 @@
}


def get_version() -> str:
return Path(Path(__file__).parent, "VERSION").read_text(encoding="utf8")


def check_path(path: str) -> Path:
exe = Path(path)
if exe.is_file and exe.exists:
Expand All @@ -97,7 +101,9 @@ def parse_args():
"""
p = argp.ArgumentParser(
description=__doc__.format(
DESKTOP_COUNT=DESKTOP_COUNT, MOBILE_COUNT=MOBILE_COUNT
DESKTOP_COUNT=DESKTOP_COUNT,
MOBILE_COUNT=MOBILE_COUNT,
VERSION=get_version(),
),
formatter_class=argp.RawDescriptionHelpFormatter,
)
Expand Down Expand Up @@ -166,7 +172,7 @@ def parse_config(default_config: Dict) -> Dict:

except FileNotFoundError:
# Make directories and default config if it doesn't exist
print(f"Autogenerating config at {str(config_file)}")
print(f"Auto-Generating config at {str(config_file)}")
os.makedirs(config_home, exist_ok=True)

with config_file.open("x") as f:
Expand All @@ -188,7 +194,7 @@ def check_python_version():
), "Only Python {}.{} and above is supported.".format(*minimum_version)


def browser_cmd(exe: Path, agent: str) -> List[str]:
def browser_cmd(exe: Path | None, agent: str) -> List[str]:
"""
Generate command to open Google Chrome with user-agent `agent`
"""
Expand All @@ -199,7 +205,7 @@ def browser_cmd(exe: Path, agent: str) -> List[str]:
return [browser, "--new-window", f'--user-agent="{agent}"']


def get_words_gen() -> str:
def get_words_gen() -> Generator:
while True:
# Wrapped in an infinite loop to support circular reading of the file
with KEYWORDS.open(mode="r", encoding="utf8") as fh:
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_long_description() -> str:


def get_version() -> str:
return Path(CURRENT_DIR, "VERSION").read_text(encoding="utf8")
return Path(CURRENT_DIR, "bing_rewards", "VERSION").read_text(encoding="utf8")


extras = {
Expand Down Expand Up @@ -56,8 +56,8 @@ def get_version() -> str:
extras_require=extras,
packages=find_packages(),
package_data={
# If any package contains text files, indlude them
"": ["data/*.txt"]
# If any package contains text files, include them
"": ["data/*.txt", "VERSION"]
},
zip_safe=False,
entry_points={"console_scripts": ["bing-rewards = bing_rewards:main"]},
Expand Down

0 comments on commit 7f39eed

Please sign in to comment.