Skip to content

Instantly share code, notes, and snippets.

@neozero
neozero / main.cpp
Last active June 26, 2024 10:53
OculusHomeless - Use Oculus Dash without Home 2.0
/************************************************************************************
Content : First-person view test application for Oculus Rift
Created : 19th June 2015
Authors : Tom Heath
Copyright : Copyright 2015 Oculus, Inc. All Rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
#!/bin/bash
APIKEY="Get key from https://api.slack.com/custom-integrations/legacy-tokens and put here"
while true
do
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
ARTIST=$(osascript -e 'tell application "Spotify" to artist of current track as string')
URLARTIST=$(echo "$ARTIST" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%20-%20"$URLARTIST"%22%2C%22status_emoji%22%3A%22%3Anotes%3A%22%7D" > /dev/null
@hestenet
hestenet / spotify-slack-status.command
Last active February 23, 2018 19:09
A bash script (renamed .command for easy execution by double-click on a Mac) for keeping your Slack status updated with currently playing artist and track in Spotify
#!/bin/bash
APIKEY="YOUR TOKEN HERE from: https://api.slack.com/custom-integrations/legacy-tokens"
while true
do
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
ARTIST=$(osascript -e 'tell application "Spotify" to artist of current track as string')
URLARTIST=$(echo "$ARTIST" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%20-%20"$URLARTIST"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null
@jgamblin
jgamblin / slackspotify.sh
Created April 19, 2017 01:10
A Script To Set Current Spotify Song As Slack Status
#!/bin/bash
APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens"
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
while true
do
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null
sleep 60
done