php - Get Yahoo calendars -
I am trying to get the list of Yahoo calendars using the next code.
$ Url = "https://calendar.yahoo.com/"; $ User = "****@yahoo.com"; $ Pwd = "*****"; $ Body = "& lt; a: Profund xmlns: A = 'dAV:' & gt; & lt; a: prop; & lt; a: display name / & gt; & lt; / a: prop & gt; Lt; / a: proffund & gt; "; $ C = curl_init ($ url); Curl_setopt ($ c, CURLOPT_HTTPHEADER, array ("Depth: 1", "Content-Type: Text / xml; Charset = 'UTF-8'", "User-agent: Devkit / 4.0.1 (730); Calendarstore / 4.0 .1 (973); ICAL / 4.0.1 (1374); Mac OS X / 10.6.2 (10C540) "); Curl_setopt ($ c, CURLOPT_HEADER, 0); Curl_setopt ($ c, CURLOPT_SSL_VERIFYHOST, 0); Curl_setopt ($ c, CURLOPT_SSL_VERIFYPEER, 0); Curl_setopt ($ c, CURLOPT_HTTPAUTH, Kernel_BASIC); Curl_setopt ($ c, CURLOPT_USERPWD, $ user. ":". $ Pwd); Curl_setopt ($ c, CURLOPT_CUSTOMREQUEST, "PROPFIND"); Curl_setopt ($ c, CURLOPT_POSTFIELDS, $ body); Curl_setopt ($ c, CURLOPT_RETURNTRANSFER, 1); $ Data = curl_exec ($ c); Curl_close ($ c); But in the response do I get 500 errors any thoughts?
In addition, I am trying to use this link, but this is a 500 error
This is very simple, if you look at the source code of that page, then you get all of these hidden input fields: < Code> & lt; Input type = "hidden" name = "session id" id = "sessionId" value = "8nPh4sVBtxEZ" & gt; & Lt; Input type = "hidden" name = "attempts" value = "1" & gt; & Lt; Input type = "hidden" name = ".src" value = "yc" & gt; & Lt; Input type = "hidden" name = ".md5" value = "" & gt; & Lt; Input type = "hidden" name = ".hash" value = "" & gt; & Lt; Input type = "hidden" name = ".js" value = "" & gt; & Lt; Input type = "hidden" name = ".last" value = "" & gt; & Lt; Input type = "hidden" name = "promo" value = "" & gt; & Lt; Input type = "hidden" name = ".intl" value = "us" & gt; & Lt; Input type = "hidden" name = ".lang" value = "en-US" & gt; & Lt; Input type = "hidden" name = ".bypass" value = "" & gt; & Lt; Input type = "hidden" name = ".partner" value = "" & gt; & Lt; Input type = "hidden" name = ".U" value = "336ng15a3fsqq" & gt; & Lt; Input type = "hidden" name = ". V" value = "0" & gt; & Lt; Input type = "hidden" name = ". Challenge" value = "vrO9R3b_b7Qwm8roug2Ea0jjlIh022jt4w -" & gt; & Lt; Input type = "hidden" name = ".Yplus" value = "" & gt; & Lt; Input type = "hidden" name = ".impresscode" value = "" & gt; & Lt; Input type = "hidden" name = "PKG" value = "" & gt; & Lt; Input type = "hidden" name = "step" value = "" & gt; & Lt; Input type = "hidden" name = ".ev" value = "" & gt; & Lt; Input type = "hidden" name = "hasMsgr" value = "0" & gt; & Lt; Input type = "hidden" name = ".chkP" value = "y" & gt; & Lt; Input type = "hidden" name = ".white" value = "http://caldav.calendar.yahoo.com/" & gt; & Lt; Input type = "hidden" name = ".pd" value = "yc_ver = 0" & amp; c = & amp; AVT = & amp; sg = "& gt; & Lt; Input type = "hidden" name = ".ws" id = ".ws" value = "0" & gt; & Lt; Input type = "hidden" name = ".cp" id = ".cp" value = "0" & gt; & Lt; Input type = "hidden" name = "nr" value = "0" & gt; & Lt; Input type = "hidden" name = "pad" id = "pad" value = "6" & gt; & Lt; Input type = "hidden" name = "account" id = "account" value = "6" & gt; And in one of them, you can
& lt; Input type = "hidden" name = ". Challenge" value = "vrO9R3b_b7Qwm8roug2Ea0jjlIh022jt4w-" & gt; For this reason "500 error" is occurring. Why? Since you are writing a boat / scraper and the login form is used between other hack prevention techniques Yahoo and all the big people are actively writing codes so that you can prevent them from doing so.
If you are actually trying to interface with the CalDAV protocol that Yahoo provides, you probably have a very different viewpoint than a CURL requests.
Comments
Post a Comment