eagle4life69 Posted October 16, 2005 Share Posted October 16, 2005 I need to recieve 2 lines of info from my web site. here is the two line 1. $song 2. $request i need to have these be displayed in my au3 file can anyone help. Link to comment Share on other sites More sharing options...
w0uter Posted October 16, 2005 Share Posted October 16, 2005 (edited) i think you mean INetGet (or _INetGetSource) Edited October 16, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
eagle4life69 Posted October 17, 2005 Author Share Posted October 17, 2005 i think you mean INetGet (or _INetGetSource)So can someone give me an example of how I would do this. All it is is text from my sql database but the easiest way is through php than trying to make it work with the DB Link to comment Share on other sites More sharing options...
w0uter Posted October 17, 2005 Share Posted October 17, 2005 just download the page that displays the 2 variabels. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
seandisanti Posted October 17, 2005 Share Posted October 17, 2005 So can someone give me an example of how I would do this. All it is is text from my sql database but the easiest way is through php than trying to make it work with the DBthis code (when modified to your info) will download the page, and save the contents of the page to a file. then all you have to do is parse out the information that you want... hopefully you have a good way to seperate what you want from what you don't, like constant labels "Song -", "Request -" etc...InetGet("http://yourpage.com/whatever.php","c:\songrequest.txt") $contents = FileRead("c:\songrequest.txt",filegetsize("C:\songrequest.txt")) Link to comment Share on other sites More sharing options...
scriptkitty Posted October 17, 2005 Share Posted October 17, 2005 I do a lot of this same thing, with a bit more complex querys. Remember, you don't have to have an html formated page when doing this. Your Php output can be a simple CSV file.extitle,requestdead puppies,playpiano man,playYou can also have sorts, and and a bunch of others in the same php file with $_GET[]Example:if(len($_GET[sort])>1){$sort=" ORDER BY " . $_GET[sort];}$query="Select * from `playlist` " . $where . $sort;In that example, you would dynamically have a sort if you sent the request like:InetGet("http://yourpage.com/whatever.php?sort=title","c:\songrequest.txt") $contents = FileRead("c:\songrequest.txt",filegetsize("C:\songrequest.txt"))You can do the same for where requests. I would be careful of doing a full query request, as if someone found your text, they could do some real damage like "Drop table playlist"For safety you can also remove certain characters that could make more than one query, but that is more pphp programming...Just echo only the result and you should have a nice clean php csv formatted file to work with. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
eagle4life69 Posted October 17, 2005 Author Share Posted October 17, 2005 (edited) Wow thanks for all the help one last thing when I do this it will only update this info once I start the program right. Is there a way I can make it so it refreshs every 30 sec? Edited October 17, 2005 by eagle4life69 Link to comment Share on other sites More sharing options...
seandisanti Posted October 17, 2005 Share Posted October 17, 2005 Wow thanks for all the help one last thing when I do this it will only update this info once I start the program right. Is there a way I can make it so it refreshs every 30 sec?check out adlib functions in the helpfile, that should do it for ya. Link to comment Share on other sites More sharing options...
eagle4life69 Posted October 17, 2005 Author Share Posted October 17, 2005 (edited) okay I just got it to download the info from the page and i have the txt now what i'm so confused by autoit. Here i will post the code I got for the player and see if you can have it display the current song that is playing and who requested it. Here is the code i have so far expandcollapse popup#include <GuiConstants.au3> InetGet("http://www.subsonicradio.com/station/plain.php","c:\songrequest.txt") $contents = FileRead("c:\songrequest.txt",filegetsize("C:\songrequest.txt")) #region Object $oMyError = ObjEvent("AutoIt.Error","Quit") $oMediaplayer = ObjCreate("WMPlayer.OCX.7") If Not IsObj($oMediaplayer) Then Exit $oMediaplayer.Enabled = true $oMediaplayer.WindowlessVideo= true $oMediaPlayer.UImode="invisible" $oMediaPlayer.URL="http://198.172.227.156:8000/" $oMediaPlayControl=$oMediaPlayer.Controls $oMediaPlaySettings=$oMediaPlayer.Settings #endregion #region GUI GuiCreate("Subsonic 128k", 215, 100,(@DesktopWidth-215)/2, (@DesktopHeight-100)/2, -1) GuiCtrlCreateLabel("Subsonic Radio Streaming Music Player", 10, 10, 200, 20) $Volume = GuiCtrlCreateSlider(20, 30, 180, 20) GuiCtrlCreateLabel("Volume", 85, 50, 40, 20) GUICtrlSetData($Volume, 100) $Play = GuiCtrlCreateButton("Play", 30, 60, 50, 30) $Stop = GuiCtrlCreateButton("Stop", 120, 60, 50, 30) GuiSetState() $VolLevel = 100 HotKeySet("{F8}", "Hide") HotKeySet("{F9}", "Show") While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Play $oMediaPlayControl.Play Case $msg = $Stop $oMediaPlayControl.Stop Case Else If GUICtrlread($Volume) <> $VolLevel Then $oMediaPlaySettings.Volume = GUICtrlRead($Volume) $VolLevel = GUICtrlRead($Volume) EndIf EndSelect WEnd Exit #endregion #region functions Func Quit() $oMediaPlayControl.Stop Exit EndFunc Func Hide() GUISetState(@SW_HIDE) EndFunc Func Show() GUISetState(@SW_SHOW) EndFunc #endregion Edited October 17, 2005 by eagle4life69 Link to comment Share on other sites More sharing options...
scriptkitty Posted October 17, 2005 Share Posted October 17, 2005 Here is a bit of code to show the info if you are only doing that one line thing like your example. while 1 tooltip("updating...",0,100) InetGet("http://www.subsonicradio.com/station/plain.php","c:\songrequest.txt") $contents = FileRead("c:\songrequest.txt",filegetsize("C:\songrequest.txt")) $playing=StringReplace($contents,"&","=") $playing=StringSplit($playing,"=") tooltip($playing[2] & @crlf & "requested by " & $playing[4],0,100) sleep(10000); 10 sec delay WEnd This only downloads the page every 10 seconds and displays it as a tooltip on your desktop. I showed how to seperate the song from the user acording to your php result. If no user is returned, none are shown. I didn't parse the full MP3 file, as it looks like you might have path and other info in there. As far as the player, you would have to pull the MP3 song, and give it to the player, etc. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
eagle4life69 Posted October 17, 2005 Author Share Posted October 17, 2005 (edited) okay tweeked and it works great but now I can't use my play stop and exit buttons (i just added a exit button) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Play $oMediaPlayControl.Play Case $msg = $Stop $oMediaPlayControl.Stop Case $msg = $Exit $oMediaPlayControl.Stop Exit Case Else If GUICtrlread($Volume) <> $VolLevel Then $oMediaPlaySettings.Volume = GUICtrlRead($Volume) $VolLevel = GUICtrlRead($Volume) EndIf EndSelect InetGet("http://www.subsonicradio.com/station/plain.php","c:\songrequest.txt") $contents = FileRead("c:\songrequest.txt",filegetsize("C:\songrequest.txt")) $playing=StringReplace($contents,"&","=") $playing=StringSplit($playing,"=") tooltip($playing[2] & @crlf & "requested by " & $playing[4],0,5) sleep(10000); 10 sec delay tooltip("",0,25) sleep(30000); 45 sec delay WEnd Exit this must be the problem Edited October 17, 2005 by eagle4life69 Link to comment Share on other sites More sharing options...
eagle4life69 Posted October 18, 2005 Author Share Posted October 18, 2005 Okay all done expandcollapse popup#include <GuiConstants.au3> InetGet("http://www.subsonicradio.com/station/plain.php","c:\songrequest.txt") $contents = FileRead("c:\songrequest.txt",filegetsize("C:\songrequest.txt")) $playing=StringReplace($contents,"&","=") $playing=StringSplit($playing,"=") #region Object $oMyError = ObjEvent("AutoIt.Error","Quit") $oMediaplayer = ObjCreate("WMPlayer.OCX.7") If Not IsObj($oMediaplayer) Then Exit $oMediaplayer.Enabled = true $oMediaplayer.WindowlessVideo= true $oMediaPlayer.UImode="invisible" $oMediaPlayer.URL="http://198.172.227.156:8000/" $oMediaPlayControl=$oMediaPlayer.Controls $oMediaPlaySettings=$oMediaPlayer.Settings #endregion #region GUI GuiCreate("Subsonic 128k", 215, 100,(@DesktopWidth-215)/2, (@DesktopHeight-100)/2, -1) GuiCtrlCreateLabel("Subsonic Radio 128k", 10, 10, 200, 20) $Volume = GuiCtrlCreateSlider(20, 30, 180, 20) GuiCtrlCreateLabel("Volume", 85, 50, 40, 20) GUICtrlSetData($Volume, 100) $Play = GuiCtrlCreateButton("Play", 30, 70, 50, 30) $Stop = GuiCtrlCreateButton("Stop", 90, 70, 50, 30) $Exit = GuiCtrlCreateButton("Exit", 150, 70, 50, 30) GuiSetState() $VolLevel = 100 HotKeySet("{F8}", "Hide") HotKeySet("{F9}", "Show") tooltip($playing[2] & @crlf & "requested by " & $playing[4],0,5) sleep(10000); 10 sec delay tooltip("",0,25) while 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Play $oMediaPlayControl.Play tooltip($playing[2] & @crlf & "requested by " & $playing[4],0,5) sleep(10000); 10 sec delay tooltip("",0,25) Case $msg = $Stop $oMediaPlayControl.Stop Case $msg = $Exit $oMediaPlayControl.Stop Exit Case Else If GUICtrlread($Volume) <> $VolLevel Then $oMediaPlaySettings.Volume = GUICtrlRead($Volume) $VolLevel = GUICtrlRead($Volume) EndIf EndSelect WEnd Exit #endregion #region functions Func Quit() $oMediaPlayControl.Stop Exit EndFunc Func Hide() GUISetState(@SW_HIDE) tooltip("",0,25) EndFunc Func Show() GUISetState(@SW_SHOW) tooltip($playing[2] & @crlf & "requested by " & $playing[4],0,5) ;sleep(10000); 10 sec delay ;sleep(30000); 45 sec delay EndFunc #endregion I fixed the problem with it not wanting to close, play or stop the song. I also made it so when you click play or bring it back from the hide position it will show the song Thanks to everyone for your help this was my first program and now I plan on doing much more Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now