Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/TheJambo/pulse
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJambo committed Aug 12, 2019
2 parents 5fc101a + d77d2d1 commit 3ce9fef
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
20 changes: 16 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Virgin Inactive
![](http://james.am/inactiveheader.png)

## What is this?
This is a selenium based project that will automate logging into your Virgin Pulse account and complete tasks to give you points.
Expand All @@ -15,13 +15,25 @@ This will earn you the following points:
- Complete 10 & 20 whil sessions in a month - 300
- Track 10 & 20 Healthy Habits in a month - 300

In total, it should give you ~3600 points per month.
In total, it should give you ~3,600 points per month or ~10,800 per quarter.

### The following features are complete:

- Daily Cards
- Daily Cards
- "Getting Active" habits
- Whil

### The following are still being developed:
- Support for all Healthy Habits (currently only supports Black Out, Stairs, Healthy Breakfast)
- Support for all Healthy Habits (currently only supports "Getting Active" habits)
- Step tracking

### How to run:

java -jar pulse.jar emailaddress password chromedriverLocation

**For example:**
java -jar pulse.jar user@domain.com Password1 C:\\pathto\chromedriver

### Pre-requisites:
To get a copy of chromedriver, go here and download whatever one is relevant for your chrome version:
http://chromedriver.chromium.org/downloads
15 changes: 12 additions & 3 deletions src/pulse/VirginPulse.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,18 @@ private static void doWhil(WebDriver driver) throws Exception {
System.out.println("Logging into Whil.");
driver.get("https://connect.whil.com/virginpulsesso/redirect?destination=series&seriesUrl=https%3A%2F%2Fconnect.whil.com%2Fcms%2Fprograms%2Ffreemium%2Fseries%2Fthrive-mindfulness-101");
System.out.println("Opening Mindfulness course.");
driver.get("https://connect.whil.com/goaltags/freemium-mindfulness-101/sessions/focus-your-attention");
System.out.println("Resuming Mindfulness course");
clickIfPresent(By.xpath("//*[@id=\"root\"]/div/div[2]/div[2]/div/div[2]/div"), driver);

driver.get("https://connect.whil.com/goaltags/freemium-mindfulness-101?w");

if (!driver.findElements(By.id("triggerCloseCurtain")).isEmpty()) {
System.out.println("Resuming Mindfulness course");
clickIfPresent(By.xpath("//*[@id=\"root\"]/div/div[2]/div[2]/div/div[2]/div"), driver);
}
else {
System.out.println("Starting Mindfulness course");
driver.get("https://connect.whil.com/goaltags/freemium-mindfulness-101/sessions/introduction-basics-with-kelly");
}

System.out.println("Playing video");
driver.findElement(By.xpath("//*[@id=\"playerContainer\"]/div[2]/button")).click();
Thread.sleep(300010); //play for 5 minutes
Expand Down

0 comments on commit 3ce9fef

Please sign in to comment.