News:

Current Full E-Touch Version: 10.2.0
Current Demo E-Touch Version: 10.0.0
Current Beta: 10.2.1 Beta 22 (09/02/23)

Main Menu

Sending What's Playing pic to Facebook

Started by fordman, February 01, 2014, 05:10:31 PM

Previous topic - Next topic

fordman

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

Barcrest

Keep on Rocking in the Free World \m/ ;D\m/



Jukebox Stats...

rumackay

Awesome! I'll have to give this a go, it's almost exactly what I've been looking for. Cheers  :beer

Barcrest

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...

Gaucho

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.

Gaucho

Spoke to soon.

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

Barcrest

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.
Keep on Rocking in the Free World \m/ ;D\m/



Jukebox Stats...

Gaucho

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.

Gaucho

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.

Gaucho

#9
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.

Gaucho

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.

Gaucho

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.

Gaucho

#12
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.

fordman

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

Gaucho

Yeah, I have since increased mine to once every 4 hours (ping -n 14400).