Skip to content

Commit

Permalink
Updated readme and renamed the main script.
Browse files Browse the repository at this point in the history
  • Loading branch information
adnantopal committed Mar 2, 2016
1 parent b244f4e commit 2d30d38
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# SNotify
SNotify gives your Spotify Windows Client two additional abilities: global hotkeys and toast notifications.

You can easily customize how toast notification looks by tweaking various options like fonts, color etc. and define hotkeys for play/pause, previous/next track and volume controls.
You can easily customize how toast notification looks by tweaking various options like fonts, colors etc. and define hotkeys for play/pause, previous/next track and volume controls.

![SNotify](http://i.imgur.com/VbMS94J.jpg)

## Installation and Usage
You have two options to download and use SNotify:
1- Visit [releases](https://github.com/adnantopal/snotify/releases) page to download latest compiled version of SNotify. Unzip release package to a location where you want the application to reside and run `SNotify.exe`.
2- If you have AutoHotkey installed in your PC, you can download master repository, unzip the package where you want the scripts to reside and run `snotify.ahk` without the need to compile AutoHotkey code.

It's recommended to use compiled versions that's described in 1st option because they're the stable releases of SNotify.

## Credits
Big thanks to [gwarble](http://gwarble.com/ahk/Notify/) for [Notify](http://gwarble.com/ahk/Notify/) script.
Expand Down
17 changes: 9 additions & 8 deletions src/spotify.ahk → src/snotify.ahk
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
;-----------------------------------------------------------
;-----------------------------------------------------------
;--- SNotify v1.0 ---
;--- ---
;--- 2016, Adnan Topal ---
;--- github.com/adnantopal/snotify ---
;-----------------------------------------------------------

SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance,Force
#Persistent

Expand Down Expand Up @@ -94,12 +94,13 @@ TitleChanged:
tempfile = %temp%\SNotifyData
searchArtist := UriEncode(trackInfo1)
searchTrack := UriEncode(trackInfo2)

FileEncoding, UTF-8
UrlDownloadToFile, https://itunes.apple.com/search?media=music&entity=musicArtist&term=%searchArtist%&entity=allTrack&term=%searchArtist%+%searchTrack%&limit=1, %tempfile%
FileRead, SNotifyData, %tempfile%
FileDelete, %tempfile%

; get album art...
; Get Album Art
artURL:= RegExReplace(SNotifyData, ".*""(artworkUrl60)"":""(.*?).jpg"".*","$2")
IfInString, artURL, resultCount
{
Expand All @@ -109,7 +110,7 @@ TitleChanged:
artwork = %tempfile%.jpg
}

; get track name
; Get Track Name
trackName:= RegExReplace(SNotifyData, ".*""(trackName)"":""(.*?)"".*","$2")
IfInString, trackName, resultCount
{
Expand All @@ -118,7 +119,7 @@ TitleChanged:
trackName:= ReplaceAll(trackName)
}

; get artist name
; Get Artist Name
artistName:= RegExReplace(SNotifyData, ".*""(artistName)"":""(.*?)"".*","$2")
IfInString, artistName, resultCount
{
Expand All @@ -127,11 +128,11 @@ TitleChanged:
artistName:= ReplaceAll(artistName)
}

; get album name
; Get Album Name
albumName:= RegExReplace(SNotifyData, ".*""(collectionName)"":""(.*?)"".*","$2")
IfInString, albumName, resultCount
{
albumName:= -
albumName:= "-"
} else {
albumName:= ReplaceAll(albumName)
}
Expand Down

0 comments on commit 2d30d38

Please sign in to comment.