ars_moriendi Posted July 19, 2007 Share Posted July 19, 2007 Hi and thanks for reading this. I'm working to create a PHP page which will sell tickets to an event that a client is holding. The ticket-seller is Brown Paper Tickets and they have an API (documentation: http://www.brownpapertickets.com/apidocs/eventlist.html. The last time I worked with an API was two years ago and in Java (not javascript, Java) and I'm working in PHP right now, where my knowledge is pretty shallow. Now, with all of this in mind, I have a few questions that I hope some of you will be kind enough to answer. 1.) I need to send calls over https using PHP without a form event and I've forgotten how. Can anyone refresh me? 2.) Once I've made those calls, I need to parse the rss data they return. Any tips? 3.) I'm certain I'll have more questions as I move through this project. Does anyone remember a similar topic discussed elsewhere that I can refer to, so I'm not continuously bothering others? I appreciate all your help. Thanks for your time. -A Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 19, 2007 Share Posted July 19, 2007 http://us2.php.net/manual/en/ref.sockets.php That will get you going also check out some of the paypal ipn scripts for the return it gives you the basic idea. Quote Link to comment Share on other sites More sharing options...
ars_moriendi Posted July 19, 2007 Author Share Posted July 19, 2007 Thanks. I'll mark this as solved and get reading. -A Quote Link to comment Share on other sites More sharing options...
ars_moriendi Posted July 19, 2007 Author Share Posted July 19, 2007 Sorry, but the information at http://us2.php.net/manual/en/ref.sockets.php is starting to turn to gobbledy-gook and I can't follow the thread. I tried the example of the tutorial at http://www.phpfreaks.com/tutorials/50/1.php, using the following: $socket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP); /*$connection = socket_connect($socket, "https://www.brownpapertickets.com/api/submitorder.html",443);*/ $connection = socket_connect($socket, "www.brownpapertickets.com",443); while($data=socket_read($socket,2046,PHP_NORMAL_READ)){ echo $data."<br />"; } Obviously, this doesn't work, but I can't seem to find a simple explanation why. If it helps to clarify (and again, please forgive my limited experience), here's the order of operations. Grab an rss feed (info at: http://www.brownpapertickets.com/apidocs/eventlist.html) Parse it. Based on the parsed info, grab another feed (info at: http://www.brownpapertickets.com/apidocs/eventdetails.html) Parse it. Repeat 3 (info at: http://www.brownpapertickets.com/apidocs/datedetails.html) Parse. Gather user info (via form). Post data to https://www.brownpapertickets.com/api/submitorder.html in four stages (info at http://www.brownpapertickets.com/apidocs/submitorder.html ) Capture returning output. Parse returned output, gather more user info. Repeat 8, 9 (3x) as necessary until finished. I understand I can open a socket to www.brownpapertickets.com, in theory, but I've been unsuccessful in doing so and am still not sure if the same rules apply when trying to send information directly to an HTML document. I'll keep looking for info on reading and parsing rss (thanks for ipn tip, by the way). Again, thanks for any help offered. -A Quote Link to comment Share on other sites More sharing options...
logged_with_bugmenot Posted July 19, 2007 Share Posted July 19, 2007 u may use magapie or simplepie to parse rss, the 2nd one is more convinient Quote Link to comment Share on other sites More sharing options...
ars_moriendi Posted July 19, 2007 Author Share Posted July 19, 2007 u may use magapie or simplepie to parse rss, the 2nd one is more convinient Thanks! I looked at MagPie and decided it wasn't for me. This helps a lot. Any idea about how I'm trying to open a connection over https? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.