Freebox Jukebox

E-Touch General Category => Tutorials => Topic started by: fordman on February 01, 2014, 05:10:31 PM

Title: Sending What's Playing pic to Facebook
Post by: fordman 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 (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 (https://www.facebook.com/help/210153612350847) or here http://heresthethingblog.com/2012/07/18/post-photos-facebook-phone-mail/ (http://heresthethingblog.com/2012/07/18/post-photos-facebook-phone-mail/)

3) Download a program called Swithmail SwithMail.zip (http://www.fordmanf150.com/etouch/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)

(http://www.fordmanf150.com/etouch/swith10.jpg)

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.

(http://www.fordmanf150.com/etouch/swith1.jpg)

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.

(http://www.fordmanf150.com/etouch/swith2.jpg)

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.

(http://www.fordmanf150.com/etouch/swith3.jpg)

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

(http://www.fordmanf150.com/etouch/swith4.jpg)

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

(http://www.fordmanf150.com/etouch/swith5.jpg)

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!

(http://www.fordmanf150.com/etouch/swith12.jpg)

(http://www.fordmanf150.com/etouch/swith6.jpg)

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

(http://www.fordmanf150.com/etouch/swith11.jpg)

If everything was setup correctly, you should get this:

(http://www.fordmanf150.com/etouch/swith7.jpg)

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

(http://www.fordmanf150.com/etouch/swith8.jpg)

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:

(http://www.fordmanf150.com/etouch/swith9.jpg)

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
Title: Re: Sending What's Playing pic to Facebook
Post by: Barcrest on February 01, 2014, 05:48:24 PM
Nice tutorial  :beer
Title: Re: Sending What's Playing pic to Facebook
Post by: rumackay 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
Title: Re: Sending What's Playing pic to Facebook
Post by: Barcrest 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.
Title: Re: Sending What's Playing pic to Facebook
Post by: Gaucho 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.
Title: Re: Sending What's Playing pic to Facebook
Post by: Gaucho 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.
Title: Re: Sending What's Playing pic to Facebook
Post by: Barcrest on May 20, 2014, 12:36:01 PM
Quote from: Gaucho 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.

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.
Title: Re: Sending What's Playing pic to Facebook
Post by: Gaucho 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.
Title: Re: Sending What's Playing pic to Facebook
Post by: Gaucho 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.
Title: Re: Sending What's Playing pic to Facebook
Post by: Gaucho 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.
Title: Re: Sending What's Playing pic to Facebook
Post by: Gaucho 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.
Title: Re: Sending What's Playing pic to Facebook
Post by: Gaucho 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.
Title: Re: Sending What's Playing pic to Facebook
Post by: Gaucho 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.
Title: Re: Sending What's Playing pic to Facebook
Post by: fordman 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
Title: Re: Sending What's Playing pic to Facebook
Post by: Gaucho on July 02, 2014, 04:11:33 PM
Yeah, I have since increased mine to once every 4 hours (ping -n 14400).
Title: Re: Sending What's Playing pic to Facebook
Post by: Johnyfroes on September 06, 2021, 02:36:03 AM
Greetings, It's been a long time since you posted this, but I just found it, I have been working a whole day on it, and it won't send out nothing, I can't seem to find the @m.facebook.com for my account. And also the etouch mail setup, it will send a mail on TEST and Song request, but it won't mail on song selections, or etouch startup or login. If, posible can you please point me in the good direction. Have a great week.
Title: Re: Sending What's Playing pic to Facebook
Post by: Barcrest on September 06, 2021, 09:24:56 AM
Facebook removes posting by email a long while back, this function no longer works. You could make it email to another account but it can't email to facebook any more.
Title: Re: Sending What's Playing pic to Facebook
Post by: Johnyfroes on September 06, 2021, 06:30:05 PM
Thanks for your reply, I sort of imagined that, but I was hoping it wasn't like that, since I'm not a deep facebook user. I still have an issue with the mailing, it will only mail to my email account requested titles, It will not mail me when ET starts or logs in, and it won't mail me when a song is selected.