Author Topic: Sending What's Playing pic to Facebook  (Read 4589 times)

Offline fordman

  • Freebox Lifetime Supporter
  • Hero Member
  • ********
  • Posts: 609
  • Fu: +2/-0
Sending What's Playing pic to Facebook
« on: February 01, 2014, 05:10:31 PM »
Hello All,

Been a while since I've done a tutorial.  :tommy

Do you see the pic in my signature at the bottom of my posts? It a pic generated by Etouch to be posted on websites/forum signatures to show what is Now Playing on your jukebox.

We can now post to Facebook. We have to do this through a couple steps.

1) Have a Facebook account
2) Facebook generates you an email address but ONLY IF YOU GIVE THEM YOUR CELL PHONE NUMBER!

You can follow how to get your facebook email address here: http://email.about.com/od/Facebook-Messages-Tips/qt/How-To-Post-Updates-And-Upload-Photos-By-Email-In-Facebook.htm or https://www.facebook.com/help/210153612350847 or here http://heresthethingblog.com/2012/07/18/post-photos-facebook-phone-mail/

3) Download a program called Swithmail SwithMail.zip

4) Extract SwithMail to a simple folder on the C: drive to anywhere but I just used C:\swithmail

5) Open SwithMail.exe in the folder you extracted it to.

6) You should see this screen, click Configure Setting (where yellow arrow is pointing)



7) Next, fill in the yellow boxes with your email settings: every provider is different. Not all use a port. GMAIL uses port 25, some use port 467. Your will vary.



8) Then, fill in the yellow boxes below: DO NOT GIVE YOUR FACEBOOK EMAIL ADDRESS TO ANYONE AS THEY CAN POST ANYTHING TO YOUR TIMELINE WITHOUT YOUR KNOWLEDGE!!!! Attachment is location of the forum.jpg that is regenerated everytime the song changes.



9) Next, Fill in the SUBJECT line as this will be the text you will see on Facebook. You dont need to add anything to the email body.



10) Then Click Save to XML. Save it as you wish but I used facebook.xml



11) You will get this when saved: Click OK.



12) Then Click GENERATE CLI String, you will get this below. Copy it as it will be your batch file string. Click 'Got It...Thanks!





13) After you have save everything, Test Your Settings:



If everything was setup correctly, you should get this:



Now, sign on to Facebook and here is what it should look like on your timeline:



Now, goto wherever you installed E-Touch. Usually in c:\Program Files but this will vary. In your E-Touch folder, create a batch file with notepad and call it test.bat Use the strings below:



Keep in mind that the .xml file will be whatever you named it in the Swithmail program.

Save it as a .bat file and not a .txt file.

Now, launch E-Touch, when it fires up, you select a song, a forum.jpg is generated and the test.bat is triggered, it will email the forum.jpg to your facebook timeline.

I use it all the time and it works really well.

Thanks for your time and if you have questions, I'll try to answer them.

Fordman
« Last Edit: February 01, 2014, 06:01:35 PM by fordman »

Offline Barcrest

  • Developer and Head Honcho.
  • Administrator
  • Hero Member
  • *****
  • Posts: 13400
  • Fu: +92/-5
  • Grooooooooovy!
Re: Sending What's Playing pic to Facebook
« Reply #1 on: February 01, 2014, 05:48:24 PM »
Nice tutorial  :beer
Keep on Rocking in the Free World \m/ ;D\m/



Jukebox Stats...

Offline rumackay

  • Freebox Lifetime Supporter
  • Jr. Member
  • ********
  • Posts: 78
  • Fu: +0/-0
Re: Sending What's Playing pic to Facebook
« Reply #2 on: February 01, 2014, 10:05:19 PM »
Awesome! I'll have to give this a go, it's almost exactly what I've been looking for. Cheers  :beer

Offline Barcrest

  • Developer and Head Honcho.
  • Administrator
  • Hero Member
  • *****
  • Posts: 13400
  • Fu: +92/-5
  • Grooooooooovy!
Re: Sending What's Playing pic to Facebook
« Reply #3 on: February 03, 2014, 08:15:43 AM »
Doing this in app we could also include a link to the FB and Twitter page for the artist unless you can use a text file with this app in which case I can get E-touch to spit this info out into a text file with the JPG. Currently I don't store this info from AudioDB or lastFM but could if there was a demand.

Either way the best way to use this would probably be with a FB page called something like "Bar Name's Playlist" as it would be posting roughly every 4 minutes on average.
Keep on Rocking in the Free World \m/ ;D\m/



Jukebox Stats...

Offline Gaucho

  • Commercial Operator
  • Hero Member
  • **********
  • Posts: 883
  • Fu: +8/-10
Re: Sending What's Playing pic to Facebook
« Reply #4 on: May 20, 2014, 11:40:52 AM »
This is almost perfect. I have a seperate facebook page for the bar and it does look good.

Slight glitch, but not sure if it's swiftmail or etouch and the forum.jpg not updating every time. Occasionally I get the same image being posted when the track changes, i.e. say Oasis is playing and the next track is Fairground Attraction, Oasis will get posted to facebook again. This can happen two or three times in a row.

Wierd, just run config as I added a new album and it hasn't done it since.

Offline Gaucho

  • Commercial Operator
  • Hero Member
  • **********
  • Posts: 883
  • Fu: +8/-10
Re: Sending What's Playing pic to Facebook
« Reply #5 on: May 20, 2014, 12:06:53 PM »
Spoke to soon.

I'll try and monitor the forum.jpg image later to make sure it is updating everytime.

Offline Barcrest

  • Developer and Head Honcho.
  • Administrator
  • Hero Member
  • *****
  • Posts: 13400
  • Fu: +92/-5
  • Grooooooooovy!
Re: Sending What's Playing pic to Facebook
« Reply #6 on: May 20, 2014, 12:36:01 PM »
Spoke to soon.

I'll try and monitor the forum.jpg image later to make sure it is updating everytime.

Are you using dual screen for the cross fading function? If so then that might be the issue with the forum JPG. I will take a look at it and check that it only calls the test.bat after the image has been created.
Keep on Rocking in the Free World \m/ ;D\m/



Jukebox Stats...

Offline Gaucho

  • Commercial Operator
  • Hero Member
  • **********
  • Posts: 883
  • Fu: +8/-10
Re: Sending What's Playing pic to Facebook
« Reply #7 on: May 20, 2014, 01:12:01 PM »
I'm only using a single screen in etouch at the moment although I have two screens set up in windows for when I want to enable videos.

Offline Gaucho

  • Commercial Operator
  • Hero Member
  • **********
  • Posts: 883
  • Fu: +8/-10
Re: Sending What's Playing pic to Facebook
« Reply #8 on: May 20, 2014, 05:55:45 PM »
O.K. sat and watched and forum.jpg isn't updating every time.

Could it be because test.bat or swiftmail is trying to access the file to soon??

If I change the attachment to forum.bmp, that doesn't always update either.

Offline Gaucho

  • Commercial Operator
  • Hero Member
  • **********
  • Posts: 883
  • Fu: +8/-10
Re: Sending What's Playing pic to Facebook
« Reply #9 on: May 21, 2014, 01:35:42 PM »
O.K. cracked it. I originally thought swithmail wasn't letting go so added taskkill to the batch file, but after a bit of experiment discovered that test.bat was trying to access the forum.jpg before it was updated, so of course meant it was being accessed already by the exe and couldn't be re-written.

This little amendment to the batch file seems to have fixed everything:

@echo off
timeout /t 20 /nobreak
cd C:\swithmail\
call SwithMail.exe /s /x "C:\SwithMail\facebook.xml"
exit

Basically ensuring etouch has time to update forum.jpg before it is accessed.
« Last Edit: May 21, 2014, 01:52:32 PM by Gaucho »

Offline Gaucho

  • Commercial Operator
  • Hero Member
  • **********
  • Posts: 883
  • Fu: +8/-10
Re: Sending What's Playing pic to Facebook
« Reply #10 on: May 22, 2014, 10:34:18 AM »
O.K. works well but had a few comments last night from people who have signed up to the bar facebook page that they are receiving message alerts every 3-5 minutes.

This leads to another use of the timeout line, I have amended it to 3600 so it only posts once an hour now.

Another task I have decided to have SwithMail do is post an image from my attract file. I use the attract mode to also advertise up coming events on the juke which I used to post manually on facebook. This way I can have a batch file in my start up folder which can post up coming events daily on facebook. Admittedly, most of my attract mode works from flash files so I may experiment to see if these work with facebook rather than creating a seperate image file.

Offline Gaucho

  • Commercial Operator
  • Hero Member
  • **********
  • Posts: 883
  • Fu: +8/-10
Re: Sending What's Playing pic to Facebook
« Reply #11 on: May 22, 2014, 03:42:45 PM »
I should point out that the timeout command only works for Windows Vista/7 and up. For XP you can replace the timeout line with:

PING -n 11 127.0.0.1>nul

Where 11 gives a wait of 10 seconds (you have to add a second to get your target). Apparently this is less processor intensive than the timeout command as well, so I may amend my batch file.

Offline Gaucho

  • Commercial Operator
  • Hero Member
  • **********
  • Posts: 883
  • Fu: +8/-10
Re: Sending What's Playing pic to Facebook
« Reply #12 on: May 23, 2014, 01:21:08 PM »
O.K. as pointed out in my post in the latest beta release my wait solution had a flaw as test.bat gets called with every track so basically I had several instances of test.bat running which defeted the object of what I was trying to do.

I have since amended my batch file so that only one instance can run at a time and it only posts to facebook once an hour (3600 seconds). My batch file now looks like this:

@echo off
tasklist /v | find /I /c "facebook" > nul
if "%ERRORLEVEL%" == "0" goto end
title facebook
PING -n 3600 127.0.0.1 > nul
cd C:\swithmail\
call SwithMail.exe /s /x "C:\SwithMail\facebook.xml"
:end
exit

Hopefully this will now work.
« Last Edit: May 23, 2014, 01:27:21 PM by Gaucho »

Offline fordman

  • Freebox Lifetime Supporter
  • Hero Member
  • ********
  • Posts: 609
  • Fu: +2/-0
Re: Sending What's Playing pic to Facebook
« Reply #13 on: July 02, 2014, 02:58:02 PM »
Im glad you figured this out because I had to turn it off as it was posting to FB about every 3 1/2 to 4 minutes and had gotten a lot of complaints.

Didnt think it would draw so much ire from people but so many were complaining, I just removed the .bat file from the folder.

Fordman

Offline Gaucho

  • Commercial Operator
  • Hero Member
  • **********
  • Posts: 883
  • Fu: +8/-10
Re: Sending What's Playing pic to Facebook
« Reply #14 on: July 02, 2014, 04:11:33 PM »
Yeah, I have since increased mine to once every 4 hours (ping -n 14400).