Skip to content

Commit

Permalink
Blinkit v2.3 - Blink Logitech devices
Browse files Browse the repository at this point in the history
With this latest version it is posible to blink Logitech devices on steem related actions
  • Loading branch information
techtek committed May 26, 2018
1 parent 3b41f67 commit 731fe57
Show file tree
Hide file tree
Showing 20 changed files with 605 additions and 29 deletions.
Binary file modified Blinkit.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion config/downloadvotes.txt
@@ -1 +1 @@
{"username":"mkt","votes":{"received":4172}}
{"username":"techtek","votes":{"received":6651}}
2 changes: 1 addition & 1 deletion config/downloadvotes2.txt
@@ -1 +1 @@
{"username":"mkt","votes":{"received":4172}}
{"username":"techtek","votes":{"received":6651}}
1 change: 1 addition & 0 deletions config/logitechcolour.txt
@@ -0,0 +1 @@
255 255 255
1 change: 1 addition & 0 deletions config/logitechdelay.txt
@@ -0,0 +1 @@
150
1 change: 1 addition & 0 deletions config/logitechnrblinks.txt
@@ -0,0 +1 @@
10
1 change: 1 addition & 0 deletions config/logitechpath.txt
@@ -0,0 +1 @@
C:\Program Files\Logitech Gaming Software\SDK\LED\x86
22 changes: 11 additions & 11 deletions config/sbdprice.txt
Expand Up @@ -3,17 +3,17 @@
"id": "steem-dollars",
"name": "Steem Dollars",
"symbol": "SBD",
"rank": "301",
"price_usd": "2.24585",
"price_btc": "0.00026404",
"24h_volume_usd": "1926990.0",
"market_cap_usd": "31402792.0",
"available_supply": "13982587.0",
"total_supply": "13982587.0",
"rank": "303",
"price_usd": "1.86967",
"price_btc": "0.0002493",
"24h_volume_usd": "1115020.0",
"market_cap_usd": "26595870.0",
"available_supply": "14224901.0",
"total_supply": "14224901.0",
"max_supply": null,
"percent_change_1h": "-0.17",
"percent_change_24h": "-0.57",
"percent_change_7d": "-14.87",
"last_updated": "1526909349"
"percent_change_1h": "-0.01",
"percent_change_24h": "-0.7",
"percent_change_7d": "-16.22",
"last_updated": "1527259748"
}
]
2 changes: 1 addition & 1 deletion config/sbdpricestriped.txt
@@ -1 +1 @@
" "price_usd": "2.24585", "
" "price_usd": "1.86967", "
22 changes: 11 additions & 11 deletions config/steemprice.txt
Expand Up @@ -3,17 +3,17 @@
"id": "steem",
"name": "Steem",
"symbol": "STEEM",
"rank": "31",
"price_usd": "2.99024",
"price_btc": "0.00035156",
"24h_volume_usd": "5484600.0",
"market_cap_usd": "766387052.0",
"available_supply": "256296168.0",
"total_supply": "273270262.0",
"rank": "30",
"price_usd": "2.76541",
"price_btc": "0.00036873",
"24h_volume_usd": "16550100.0",
"market_cap_usd": "709847226.0",
"available_supply": "256687878.0",
"total_supply": "273661972.0",
"max_supply": null,
"percent_change_1h": "-0.46",
"percent_change_24h": "-1.37",
"percent_change_7d": "-5.31",
"last_updated": "1526909347"
"percent_change_1h": "-0.01",
"percent_change_24h": "-5.46",
"percent_change_7d": "-5.57",
"last_updated": "1527259747"
}
]
2 changes: 1 addition & 1 deletion config/steempricestriped.txt
@@ -1 +1 @@
" "price_usd": "2.99024", "
" "price_usd": "2.76541", "
2 changes: 1 addition & 1 deletion config/webcammode.txt
@@ -1 +1 @@
LED
Picture
2 changes: 1 addition & 1 deletion config/welcome.txt
Expand Up @@ -5,7 +5,7 @@
|| || || || | ||| || || || ||
.||...|' .||.....| .||. .|. '| .||. ||. .||. .||.

USB Flash Notifications Version 2.2
USB Flash Notifications Version 2.3
Made by Techtek https://steemit.com/@techtek/

Starting...
Expand Down
2 changes: 1 addition & 1 deletion config/welcomearduino.txt
Expand Up @@ -5,7 +5,7 @@
|| || || || | ||| || || || ||
.||...|' .||.....| .||. .|. '| .||. ||. .||. .||.

USB Flash Notifications Version 2.2
USB Flash Notifications Version 2.3
Made by Techtek https://steemit.com/@techtek/

Arduino Sketch made by Electronicsworld https://steemit.com/@Electronicsworld/
Expand Down
14 changes: 14 additions & 0 deletions config/welcomelogitech.txt
@@ -0,0 +1,14 @@

'||''|. '||' '||' '|. '|' '||' |' '||' |''||''|
|| || || || |'| | || .' || ||
||'''|. || || | '|. | ||'|. || ||
|| || || || | ||| || || || ||
.||...|' .||.....| .||. .|. '| .||. ||. .||. .||.

USB Flash Notifications Version 2.3
Made by Techtek https://steemit.com/@techtek/

Logitech code is developed by Flash4yard https://steemit.com/@flash4yard/

Starting...

134 changes: 134 additions & 0 deletions followerslogitech.bat
@@ -0,0 +1,134 @@
@echo off

:: Take and put the username from username.txt and put it in variable %username%
set /p steemusername=<config\username.txt

:: Check if a sound notification is set On/Off, stored in \config\ and put it into variable %soundsetting%
set /p soundsetting=<config\soundsetting.txt

:: Get the sound set by the user in the Blinkit GUI, stored in \config\ and put it into variable %sound%
set /p sound=<config\sound.txt



:: Colour settings
set ESC=
set Red=%ESC%[31m
set White=%ESC%[37m
set Green=%ESC%[32m
set Magenta=%ESC%[35m
set Blue=%ESC%[94m

:: Display welcome message to the user welcome.txt
type config\welcomelogitech.txt



:: Let the user know that Blinkit is going to watch for Followers by displaying the text:
echo Blinkit - Steem Account Followers

:: Let the user know a sound is being played by displaying the text:
echo.
echo %Magenta%Testing %White%Play sound...

:: Play and test Sound notification
set /p sound=<config\sound.txt
set "file=sounds\%sound%"
( echo Set Sound = CreateObject("WMPlayer.OCX.7"^)
echo Sound.URL = "%file%"
echo Sound.Controls.play
echo do while Sound.currentmedia.duration = 0
echo wscript.sleep 100
echo loop
echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sounds\sound.vbs

if %soundsetting%==On (start /min sounds\sound.vbs) else (echo Sound notifications are turned off)
echo.



:: Test the Logitech blink action
echo %Magenta%Testing %White%Blink led
start logitechblink.exe
echo.


:: Download the latest STEEM and SBD Price and put it inside a txt files
powershell -Command "Invoke-WebRequest https://api.coinmarketcap.com/v1/ticker/steem/ -OutFile config\steemprice.txt"
powershell -Command "Invoke-WebRequest https://api.coinmarketcap.com/v1/ticker/steem-dollars/ -OutFile config\sbdprice.txt"

:: Find and display the latest STEEM and SBD Price in USD from the downloaded txt files
echo Steem Price
for /F "delims=" %%a in ('findstr /I ""price_usd"" config\steemprice.txt') do set "batToolDir0=%%a"
for /F "delims=" %%a in ('findstr /I ""price_usd"" config\sbdprice.txt') do set "batToolDir2=%%a"
echo %Blue%Steem: "%batToolDir0%"
echo %Blue%Steem Dollar: "%batToolDir2%"

:: Update the STEEM and SBD price in USD into txt files for the steem prices in the Blinkit interface
echo "%batToolDir0%" > "config\steempricestriped.txt"
echo "%batToolDir2%" > "config\sbdpricestriped.txt"
echo.

:: Display Steem username
echo %White%Steem Username
echo %Blue%%steemusername%%White%
echo.

:: Download the number of Followers from a user inside a txt file
powershell -Command "Invoke-WebRequest https://api.steem.place/getFollowersCount/?a=%steemusername% -OutFile config\displayfollowers.txt"

:: Display the downloaded followers
echo %White%Followers%Blue%
type config\displayfollowers.txt
echo.

:: Display the saved Username and let the user know that the program is starting
echo.
echo %White%Preparing BlinkIt,
echo Notifications for %Blue%%steemusername%%White% on Logitech ...
timeout 4


:: Blinkit Followers Script

:: Download followers data from Web Api and save it into a txt file
powershell -Command "Invoke-WebRequest https://api.steem.place/getFollowersCount/?a=%steemusername% -OutFile config\download.txt"

:main
:: Download followers data from Web Api and save it into a txt file
powershell -Command "Invoke-WebRequest https://api.steem.place/getFollowersCount/?a=%steemusername% -OutFile config\download2.txt"

:: Compare the 2 downloaded follower txt files if different go to "notification", if the files are the same go to "next"
fc config\download.txt config\download2.txt > nul
if errorlevel 1 goto notification
if errorlevel 0 goto next


:next
:: let the user know the program is running by displaying the text:
echo.
echo %Magenta%Blinkit is running...

:: Download new data to compare, into "download2.txt", and go back to "main" to compare the files again
powershell -Command "Invoke-WebRequest https://api.steem.place/getFollowersCount/?a=%steemusername% -OutFile config\download2.txt"
goto main


:notification
:: Let the user know, there is a new Follower! by displaying the text:
echo Blinkit is running... %Blue%NEW FOLLOWER for %steemusername%!
echo %White%
echo %Magenta%ACTION LED BLINKED!

:: Let the user know, there is a new Follower, and blink the Logitech device
start logitechblink.exe

:: Play the notification sound if turned on by the user
if %soundsetting%==On (start /min sounds\sound.vbs) else (echo Sound notifications are turned off)
echo.
timeout 3
echo %White%

:: Download new data to compare, and go back to "main" and continue to look for for new Followers.
powershell -Command "Invoke-WebRequest https://api.steem.place/getFollowersCount/?a=%steemusername% -OutFile config\download.txt"
goto main
Binary file added logitechblink.exe
Binary file not shown.

0 comments on commit 731fe57

Please sign in to comment.