Skip to content

Commit

Permalink
Beam to mixer
Browse files Browse the repository at this point in the history
  • Loading branch information
jg committed May 25, 2017
1 parent 9fce4e8 commit 0722625
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Firebot
An app to run various interactive buttons for mixer.pro streamers.
An app to run various interactive buttons for mixer.com streamers.

## Remastered?
The original Firebot was just a plain js file that I kept building on. This version, the remastered edition, takes what I built and layers it on top of my other project mixerChatPlays. All of this will run as a desktop app and allow people to use a multitude of different types of interactive buttons.
Expand Down
2 changes: 1 addition & 1 deletion gui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ <h4 class="modal-title" id="errorLabel">Error</h4>
<h4 class="modal-title" id="addInteractiveBoardLabel">Add New Board</h4>
</div>
<div class="modal-body">
<p>To add a board to Firebot go to the <a href="https://mixer.pro/i/studio">mixer interactive studio</a> and create a project. Organize and create buttons however you want. Once done, you'll be given a five digit number in the "code" tab. Copy and paste that below.</p>
<p>To add a board to Firebot go to the <a href="https://mixer.com/i/studio">mixer interactive studio</a> and create a project. Organize and create buttons however you want. Once done, you'll be given a five digit number in the "code" tab. Copy and paste that below.</p>
<div class="input-group">
<input type="text" class="form-control add-new-board-code" placeholder="Enter code">
</div><!-- /input-group -->
Expand Down
4 changes: 2 additions & 2 deletions gui/js/interactive/interactive-board.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function importBoardModal(){
function boardBuilder(versionid){

// Hit up mixer for the latest json.
$.getJSON( "https://mixer.pro/api/v1/interactive/versions/"+versionid, function( data ) {
$.getJSON( "https://mixer.com/api/v1/interactive/versions/"+versionid, function( data ) {
var gameName = data.game.name;
var gameJson = data.controls.scenes;

Expand Down Expand Up @@ -130,7 +130,7 @@ function sceneBuilder(gameName){
$('.interactive-board-container').html(boardTemplate);

// Throw the board title onto the page.
$('.board-title a').attr('href', 'https://mixer.pro/i/studio').text(gameName);
$('.board-title a').attr('href', 'https://mixer.com/i/studio').text(gameName);

// Set as last used board.
var dbSettings = new JsonDB("./user-settings/settings", true, true);
Expand Down
14 changes: 7 additions & 7 deletions gui/js/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var options = {
function login(type){

// Make a request to get a shortcode.
request.post({url:'https://mixer.pro/api/v1/oauth/shortcode', form: {client_id: options.client_id, scope: options.scopes}}, function(err,httpResponse,body){
request.post({url:'https://mixer.com/api/v1/oauth/shortcode', form: {client_id: options.client_id, scope: options.scopes}}, function(err,httpResponse,body){
if (err === null){
// Success!
var body = JSON.parse(body);
Expand Down Expand Up @@ -50,7 +50,7 @@ function loginModal(code){
</div>
<div class="modal-body">
<p>Click the code below to be taken to an authorization page. On the auth page please paste in the code to give Firebot access to run on your account.</p>
<div class="login-code">Code: <br> <a href="https://mixer.pro/go">${code}</a></div>
<div class="login-code">Code: <br> <a href="https://mixer.com/go">${code}</a></div>
</div>
</div>
</div>
Expand All @@ -71,7 +71,7 @@ function loginModal(code){
function loginLoop(handle, type){

var refreshInterval = setInterval(function(){
request.get('https://mixer.pro/api/v1/oauth/shortcode/check/'+handle, function (error, response, body) {
request.get('https://mixer.com/api/v1/oauth/shortcode/check/'+handle, function (error, response, body) {
var status = response.statusCode;

// User denied access or key expired.
Expand All @@ -90,7 +90,7 @@ function loginLoop(handle, type){
var code = body.code;

// Take the code and send it off for the auth tokens info.
request.post({url:'https://mixer.pro/api/v1/oauth/token', form: {client_id: options.client_id, code: code, grant_type: "authorization_code"}}, function(err,response,body){
request.post({url:'https://mixer.com/api/v1/oauth/token', form: {client_id: options.client_id, code: code, grant_type: "authorization_code"}}, function(err,response,body){
if (err === null){
console.log('Success! Trying to get token...');
var body = JSON.parse(body);
Expand Down Expand Up @@ -124,7 +124,7 @@ function userInfo(type, accessToken, refreshToken){

// Request user info and save out everything to auth file.
request({
url: 'https://mixer.pro/api/v1/users/current',
url: 'https://mixer.com/api/v1/users/current',
auth: {
'bearer': accessToken
}
Expand Down Expand Up @@ -198,7 +198,7 @@ function refreshToken(){
var refresh = dbAuth.getData('./streamer/refreshToken');

// Send off request for new tokens.
request.post({url:'https://mixer.pro/api/v1/oauth/token', form: {client_id: options.client_id, grant_type: "refresh_token", refresh_token: refresh}}, function(err,response,body){
request.post({url:'https://mixer.com/api/v1/oauth/token', form: {client_id: options.client_id, grant_type: "refresh_token", refresh_token: refresh}}, function(err,response,body){
if (err === null){
console.log('Refreshing tokens for streamer!');
var body = JSON.parse(body);
Expand All @@ -222,7 +222,7 @@ function refreshToken(){
var refresh = dbAuth.getData('./bot/refreshToken');

// Send off request for new tokens.
request.post({url:'https://mixer.pro/api/v1/oauth/token', form: {client_id: options.client_id, grant_type: "refresh_token", refresh_token: refresh}}, function(err,response,body){
request.post({url:'https://mixer.com/api/v1/oauth/token', form: {client_id: options.client_id, grant_type: "refresh_token", refresh_token: refresh}}, function(err,response,body){
if (err === null){
console.log('Refreshing tokens for bot!');
var body = JSON.parse(body);
Expand Down
13 changes: 12 additions & 1 deletion lib/interactive/mixer-interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,18 @@ function makeAllScenes(){

// Get settings for last board.
var dbControls = new JsonDB("./user-settings/controls/"+gameName, true, true);
var gameJson = dbControls.getData('/mixer');

// Beam Convert.
// This is temporarily in place to convert people's json files from Beam to mixer.
try{
// Beam info exists, convert it to mixer.
var gameJson = dbControls.getData('/beam');
dbControls.push('/mixer', gameJson);
dbControls.delete('/beam');
}catch(err){
// Beam info doesn't exist, grab mixer.
var gameJson = dbControls.getData('/mixer');
}

// Loop through scenes and send them off to be built.
for (scene of gameJson){
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Firebot",
"version": "3.0.0-beta.1",
"description": "An application for mixer.pro that celebrates and promotes interactive controls.",
"description": "An application for mixer.com that celebrates and promotes interactive controls.",
"main": "main.js",
"scripts": {
"start": "electron .",
Expand All @@ -22,7 +22,7 @@
"repository": "https://github.com/Firebottle/Firebot",
"keywords": [
"Electron",
"mixer.pro",
"mixer.com",
"interactive",
"streaming"
],
Expand Down

0 comments on commit 0722625

Please sign in to comment.