Skip to content

Commit c33e2e3

Browse files
authored
2.0.0 (#208)
2 parents 2a599ad + 5f55f55 commit c33e2e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2078
-1041
lines changed

.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ignore everything
2+
*
3+
4+
# Allow files and directories
5+
!/localized_activities
6+
!/src
7+
!/main.py
8+
!/docker.sh
9+
!/requirements.txt
10+
11+
# Ignore unnecessary files inside allowed directories
12+
# This should go after the allowed directories
13+
**/*~
14+
**/*.log
15+
**/.DS_Store
16+
**/Thumbs.db

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @cal4
2+
src/readToEarn.py @jdeath

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
(I have checked every bug report on GitHub)
1414
required: true
1515
- label: |
16-
I've cleared the sessions folder.
16+
I've ran the program with the -r argument.
1717
required: true
1818
- type: dropdown
1919
id: branch
@@ -44,9 +44,10 @@ body:
4444
- type: textarea
4545
id: logs
4646
attributes:
47-
label: Copy and paste your error
47+
label: Import the logs
4848
description: |
49-
From the terminal that was running the farmer, copy and paste the error/bug here.
49+
Paste the `logs/activity.log` file, or the `logs/activity-*.log` file containing the error.
50+
placeholder: Don't write the logs here, just drag and drop the file here
5051
validations:
5152
required: true
5253
- type: textarea

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
12+
target-branch: "develop"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v4
16+
- name: Docker meta
17+
id: meta
18+
uses: docker/metadata-action@v5
19+
with:
20+
images: ${{ secrets.DOCKERHUB_USERNAME }}/ms-rewards
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@v2
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v2
25+
- name: Login to DockerHub
26+
uses: docker/login-action@v2
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_TOKEN }}
30+
- name: Build and push
31+
uses: docker/build-push-action@v5
32+
with:
33+
context: .
34+
platforms: linux/amd64,linux/arm64
35+
push: true
36+
tags: ${{ steps.meta.outputs.tags }}
37+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,17 @@ pyrightconfig.json
176176

177177
# End of https://www.toptal.com/developers/gitignore/api/python
178178

179+
# MacOS
180+
.DS_Store
181+
.AppleDouble
182+
.LSOverride
183+
Icon
184+
._*
185+
179186
# Custom rules (everything added below won't be overridden by 'Generate .gitignore File' if you use 'Update' option)
180187

181-
accounts.json
182-
sessions
183-
logs
184-
runbot.bat
185-
.DS_Store
186-
/google_trends.dat
187-
/google_trends.dir
188-
/google_trends.bak
189-
/config-private.yaml
188+
sessions/
189+
logs/
190+
/google_trends.*
191+
config.yaml
192+
MsReward.xml

.pylintrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,15 @@ disable=raw-checker-failed,
439439
fixme,
440440
invalid-name,
441441
missing-function-docstring,
442-
missing-module-docstring
442+
missing-module-docstring,
443+
broad-exception-caught, # As we catch any error to avoid stopping tasks and sending correct apprise notifications
444+
attribute-defined-outside-init, # As we set attributes outside __init__ in many cases
445+
logging-fstring-interpolation, # As we always log at the DEBUG level, so lazy interpolation doesn't change anything
446+
logging-not-lazy,
447+
too-many-branches,
448+
too-many-instance-attributes,
449+
too-many-statements,
450+
too-few-public-methods
443451

444452
# Enable the message, report, category or checker with the given id(s). You can
445453
# either give multiple identifier separated by comma (,) or put this option

.template-config-private.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,59 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.0.0] - 2025-04-08
9+
10+
### Added
11+
12+
- Consolidated all language-specific data into a single dictionary for `localized_activities`, simplifying management and improving performance.
13+
- New activity handling.
14+
- Added country and language code validation functions and updated browser geolocation handling.
15+
- Added configuration options in `config.yaml` for activity handling and error notifications:
16+
- `apprise.notify.incomplete-activity` for incomplete activity notifications.
17+
- `apprise.notify.login-code` for login with phone code notifications.
18+
- Added reset functionality to delete session files and terminate Chrome processes.
19+
- Added CODEOWNERS file for repository management.
20+
- Added Docker build for easier deployment and execution.
21+
- Added `run.ps1` script with the following features:
22+
- Automatic detection of Python installations or virtual environments.
23+
- Retry logic for running the main script with configurable maximum attempts.
24+
- Automatic cleanup of Chrome processes and session files on failure.
25+
- Support for updating the script via Git if in a Git repository.
26+
- Command-line options for customization, including Python path, script directory, and session folder.
27+
28+
### Changed
29+
30+
- Improved retry logic in `getBingInfo` and updated backoff factor configuration.
31+
- Updated `config.yaml` to enhance logging and error reporting configurations.
32+
- Refactored activity handling to use localized titles and queries.
33+
- Improved logging for activity completion, error reporting, and localization warnings.
34+
- Enhanced JSON response handling in `utils.py` and updated parameters in `run.ps1`.
35+
- Replaced `accounts.json` with account information now stored in `config.yaml` for better configuration management.
36+
- Adjusted cooldowns and wait times for better performance.
37+
38+
### Fixed
39+
40+
- Fixed issues with quiz completion logic for "This or That" and "ABC" activities.
41+
- Addressed edge cases where activities were incorrectly marked as incomplete.
42+
- Fixed activities containing non-breakable spaces in their names.
43+
- Fixed Google Trends API integration and improved trend keyword handling.
44+
- Fixed click handling in `activities.py` to use the correct answer element.
45+
- Fixed issue related to mobile search for level 1 users.
46+
- Fixed Apprise notification error.
47+
- Fixed exit code to return `exit 1` on errors instead of `exit 0`.
48+
49+
### Removed
50+
51+
- Removed unused imports and deprecated classes for cleaner codebase.
52+
- Removed `MS_reward.bat` in favor of the more robust `run.ps1` script.
53+
- Removed `config-private.yaml` in favor of consolidating configurations into `config.yaml`.
54+
- Removed password logging.
55+
56+
### Other
57+
58+
- Added locked/banned user detection.
59+
- Skipped un-doable activities.
60+
861
## [1.1.0] - 2024-08-30
962

1063
### Added
@@ -87,11 +140,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
87140

88141
- New [config.yaml](config.yaml) options
89142
- `retries`
90-
- `base_delay_in_seconds`: how many seconds to delay
143+
- `base-delay-in-seconds`: how many seconds to delay
91144
- `max`: the max amount of retries to attempt
92145
- `strategy`: method to use when retrying, can be either:
93-
- `CONSTANT`: the default; a constant `base_delay_in_seconds` between attempts
94-
- `EXPONENTIAL`: an exponentially increasing `base_delay_in_seconds` between attempts
146+
- `CONSTANT`: the default; a constant `base-delay-in-seconds` between attempts
147+
- `EXPONENTIAL`: an exponentially increasing `base-delay-in-seconds` between attempts
95148
- `apprise.summary`: configures how results are summarized via Apprise, can be either:
96149
- `ALWAYS`: the default, as it was before, how many points were gained and goal percentage if set
97150
- `ON_ERROR`: only sends email if for some reason there's remaining searches

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.11-slim
2+
3+
COPY . /app
4+
5+
WORKDIR /app
6+
7+
ENV LANG=en_US.UTF-8
8+
ENV LANGUAGE=en_US:en
9+
ENV LC_ALL=en_US.UTF-8
10+
11+
RUN apt-get update && \
12+
DEBIAN_FRONTEND=noninteractive apt-get install -y chromium chromium-driver cron locales && \
13+
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
14+
locale-gen en_US.UTF-8 && \
15+
chmod +x /app/docker.sh && \
16+
rm -rf /var/lib/apt/lists/* && \
17+
rm -rf /etc/cron.*/* && \
18+
pip install --no-cache-dir -r requirements.txt
19+
20+
CMD ["/app/docker.sh"]

MS_reward.bat

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)