Skip to Content
It is currently November 19th, 2018, 7:56 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 715 posts ]  Go to page Previous  1 ... 44, 45, 46, 47, 48  Next
Author Message
PostPosted: August 14th, 2016, 1:48 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7634
Location: Aachen (Germany)
The PAL update from thursday was broken, sorry.
I was informed about the error this morning, but didn't have a chance to look at it until I got home a few minutes ago.

A new, fixed version is online now.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: August 14th, 2016, 1:56 pm 
Offline
Senior User
Senior User

Joined: February 9th, 2011, 3:21 pm
Posts: 121
Hmmm...I am just using this new script (since you launched it last fall) for the first time.

Just now, after seeing your message that a new, fixed version is online now, I went ahead and tried to generate a new Facebook PAL script at the site. I downloaded that to my computer, imported it into SAM -- and still getting the same error message. Compiler Errors.

Is it something I'm doing wrong? Thanks for your efforts and help as always Benedikt.


Top
 Profile  
Reply with quote  
PostPosted: August 14th, 2016, 2:02 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7634
Location: Aachen (Germany)
Version 16.08-14a works just fine.

The problem is in line 42:
Code:
// OLD
    status := StringReplace(URLEncode(Trim(prefix + status + postfix)), '/', '%2F');
// NEW
    status := StringReplace(URLEncode(Trim(prefix + status + postfix)), '/', '%2F', TRUE);

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: August 14th, 2016, 10:02 pm 
Offline
Senior User
Senior User

Joined: February 9th, 2011, 3:21 pm
Posts: 121
Thanks very much. I now have the current version and it seems to be working properly. I'll just monitor it to see if it posts (I set it to post once every 60 songs). Much appreciated.


Top
 Profile  
Reply with quote  
PostPosted: August 17th, 2016, 3:18 am 
Offline
Senior User
Senior User

Joined: February 9th, 2011, 3:21 pm
Posts: 121
Although the PAL script is no longer indicating any errors, for some reason, it is still not yet posting to Facebook. Any ideas?

Code:

{**
 * SAM Broadcaster Web2.0 Connector (twitter)
 *
 * @copyright          2016 by Benedikt Bauer | http://www.sam-song.info
 * @version              16.08-14a
 * @link                    http://www.sam-song.info
 * @author                Benedikt Bauer
 *
 * @license
 * The contents of this file are subject to the
 *            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
 *                   Version 2, December 2004
 *
 * Copyright for this License (C) 2004 Sam Hocevar <sam@hocevar.net>
 *
 * Everyone is permitted to copy and distribute verbatim or modified
 * copies of this license document, and changing it is allowed as long
 * as the name is changed.
 *
 *            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
 *   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 *
 *  0. You just DO WHAT THE FUCK YOU WANT TO.
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
 *}



/////////////////////////////////////////////////////////////////////
//    Nettiquette                                                  //
//    You may use this PAL Script to communicate with my server    //
//    Change it to your like but don't flood the server/network    //
//                                                                 //
//    Also make sure you don't post any inappropriate messages     //
//    Either me or twitter/fb might then cease to run this service //
//                                                                 //
//    This service has no guaranteed uptime nor support            //
//    However you may ask Questions in the Spacialaudio Forums     //
//    I will probably come back to you and help                    //
//                                                                 //
//    The Webservice will stay private                             //
//    At least until its completely done and tidied up             //
//                                                                 //
//                                                                 //
//    Don't make any changes outside of boxes like this            //
//    unless you really know what you do.                          //
//    I won't give any support if you changed something            //
//    you better shouldn't have touched                            //
//                                                                 //
/////////////////////////////////////////////////////////////////////

{Declaration (Constants)}
CONST DEBUG = TRUE;

{Declaration (Variables)}
var     Player : TPlayer;
var     Song : TSongInfo;
var     statusmessage, returnmessage, picture : String;
var     ErrorLog, DebugLog : String;
var     tempFolder : String = 'C:\sam-song.info';
var     prefix  : String = 'Now Playing on Harry Chapin Radio:   ';
var     postfix : String = ' Tune in now on your computer at HarryChapinRadio.com and on your mobile device at HarryChapinRadio.org';
var     waitfornextday : Boolean = FALSE;

{Declaration (Functions and Procedures)}
// Construct the GET String for the Web Script, call it and return the output
FUNCTION update(status, picture : String) : String; forward;

// Write Error / Debug Log
PROCEDURE WriteLog(msg : String; error : boolean); forward;


// BEGIN MAIN
PAL.Loop := True;

PAL.LockExecution;
Player := ActivePlayer;

// Is anything playing right now?
IF ( Player <> NIL ) THEN
BEGIN
    Song := Player.GetSongInfo;
    IF (Song <> NIL) AND (Pos(Song['songtype'],'J') > 0) THEN
    BEGIN
        // Message to display in twitter
        statusmessage := Song['artist'] + ' - ' + Song['title'];

        picture := Song['picture'];

        IF (Pos('jpg', picture) = 0) AND (Pos('png', picture) = 0)  THEN
        BEGIN
            picture := 'na.gif'
        END;

        returnmessage := update(statusmessage, picture);

        // Errormessages don't contain the underscore
        IF ( Pos('##', returnmessage) = 0 )  THEN
        BEGIN
            // Special Errormessage for Queue is full => In that case wait for the next day
            IF (Pos('!!', returnmessage) = 0) THEN
            BEGIN
                waitfornextday := TRUE;
            END;
            WriteLog(returnmessage, TRUE)
        END
        // For debugging purposes Successful Posts will be logged as well
        ELSE
        BEGIN
            WriteLog(returnmessage, FALSE);
        END;
    END;
END;

Song.Free;
Player.Free;
PAL.UnlockExecution;
PAL.WaitForPlayCount(60);
WHILE (waitfornextday) DO
BEGIN
    // Try again after 30 minutes if twuitter or google have queue problems
    PAL.WaitForTime('+00:30:00');
    waitfornextday := FALSE;
END;
// END MAIN



FUNCTION update(status, picture : String) : String;
var getstr,returnstr : String;
BEGIN
    // IF status contains leading/trailing whitespace, remove whitespace from prefix and postfix
    IF (Length(Trim(status)) < Length(status)) THEN
    BEGIN
        prefix := Trim(prefix);
        prefix := Trim(postfix);
    END;

    // manually replace forward slashes in URLs
    status := StringReplace(URLEncode(Trim(prefix + status + postfix)), '/', '%2F', TRUE);
    // normal URL encoding applied to filename to protect special characters
    picture := URLEncode(picture);
    getStr := 'http://songposter.net' + '/' + 'send-post' + '/'
        + 'facebook' + '/' + '0' + '/' + '104' + '/' + '****' + '/' + status + '/' + picture;

    WriteLog(getStr, FALSE);

    // Here goes the magic!
    returnstr := WebToStr(getStr);

    result := returnstr;
END;

PROCEDURE WriteLog(msg : String; error : boolean);
BEGIN
    IF NOT SetCurrentDir(tempFolder) THEN
    BEGIN
        CreateDir(tempFolder);
        SetCurrentDir(tempFolder);
    END;

    PAL.LockExecution;
    IF Pos('Awesome', msg) > 0 THEN
    BEGIN
        msg := DateTimeToStr(NOW) + '  ' + msg + chr(13) + chr(10);
        Writeln(msg);
    END
    ELSE
        SaveStringToFile('facebook.0-error.html', msg);

    IF error THEN
    BEGIN
        //ERROR LOG create if not exists
        IF FileExists('facebook.0-error.log') THEN
            AppendStringToFile('facebook.0-error.log', msg)
        ELSE
            SaveStringToFile('facebook.0-error.log', msg)
    END
    ELSE IF DEBUG THEN
    BEGIN
        //DEBUG LOG create if not exists
        IF FileExists('facebook.0-debug.log') THEN
            AppendStringToFile('facebook.0-debug.log', msg)
        ELSE
            SaveStringToFile('facebook.0-debug.log', msg);
    END;
    PAL.UnlockExecution;
END;


Last edited by Mastacheata on August 17th, 2016, 6:32 am, edited 2 times in total.
use square brackets for tags; masked your password


Top
 Profile  
Reply with quote  
PostPosted: August 17th, 2016, 11:10 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7634
Location: Aachen (Germany)
I can only tell now, that you exceeded your daily limit.
You apparently never asked for it to be lifted and that means you were fine with 24 posts / day, right?

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: August 17th, 2016, 4:27 pm 
Offline
Senior User
Senior User

Joined: February 9th, 2011, 3:21 pm
Posts: 121
I set it up to only post once every 60 songs (thus roughly once every 5 hours, or about 5 times a day; well under the limit). So far not a single post has appeared on my Facebook page at www.facebook.com/harrychapin1.

I thought I set it up correctly on songposter.net but perhaps not? Thanks.


Top
 Profile  
Reply with quote  
PostPosted: August 17th, 2016, 4:27 pm 
Offline
Senior User
Senior User

Joined: February 9th, 2011, 3:21 pm
Posts: 121
I set it up to only post once every 60 songs (thus roughly once every 5 hours, or about 5 times a day; well under the limit). So far not a single post has appeared on my Facebook page at www.facebook.com/harrychapin1.

I thought I set it up correctly on songposter.net but perhaps not? Thanks.


Top
 Profile  
Reply with quote  
PostPosted: August 17th, 2016, 6:10 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7634
Location: Aachen (Germany)
Yeah, I slipped in the rows. That wasn't actually you who had the 50+ successful attempts.
I've still got no idea why your attempts fail.

Can you look in C:\sam-song.info and send me the log files? Especially facebook.0-error.log and -debug.log (or if that's easier, just zip the whole folder).
I'd rather move this to our ticket system (send an email to support@songposter.net or use the help widget on the songposter website)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: August 18th, 2016, 7:35 pm 
Offline
Senior User
Senior User

Joined: February 9th, 2011, 3:21 pm
Posts: 121
Hi Benedikt,
I tried to send you an email to support@songposter.net and also to the address on the site (support@sam-song.info) but both of them bounced back to me as undeliverable. I couldn't use the help widget on the site because it doesn't allow me to upload attachments.

Is there another email address I should try? Thanks.


Top
 Profile  
Reply with quote  
PostPosted: August 19th, 2016, 2:32 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7634
Location: Aachen (Germany)
They're all on the same server.
But you can try my Gmail address (Mastacheata+samforum@gmail.com)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: August 19th, 2016, 10:55 pm 
Offline
Senior User
Senior User

Joined: February 9th, 2011, 3:21 pm
Posts: 121
Thanks; I just sent it to your gmail account.


Top
 Profile  
Reply with quote  
PostPosted: February 19th, 2017, 8:15 pm 
Offline
Senior User
Senior User

Joined: February 9th, 2011, 3:21 pm
Posts: 121
Benedikt, I'd like to activate the SAM Song Info Poster onto our station's Facebook page (I had previously used it a couple of years ago to post to a personal Facebook account -- but now I want to post it to a Page).

How do I provide you (or the script) with the login credentials for that and get it to work on our Facebook page and Twitter account? Thank you.


Top
 Profile  
Reply with quote  
PostPosted: February 19th, 2017, 9:00 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7634
Location: Aachen (Germany)
The old version at sam-song.info? Simple. You don't.
Getting a small app like ours approved for posting to facebook is almost impossible.

That's why we go through a third party provider bundling all the social media connections in the new version.
Just join the Google group and you will find out all the details there.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: February 19th, 2017, 9:58 pm 
Offline
Senior User
Senior User

Joined: February 9th, 2011, 3:21 pm
Posts: 121
I'm a member of the Google "Song Poster Testing" group (have been for about a year) and I've accessed the link from there to songposter.net and logged in there and updated my credentials. But when I download the PAL Script via the Facebook tab there, it looks like the script mentions Twitter at the top of the script instead of Facebook. Not sure what I've done wrong? Thanks.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 715 posts ]  Go to page Previous  1 ... 44, 45, 46, 47, 48  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group