Jump to content

christo16

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

christo16's Achievements

Member

Member (2/5)

0

Reputation

  1. This should be pretty easy, I tried some things I saw on this forum but I just couldn't get it to work, I gotta get better with regex. Here is the data I am trying to extract from: HTTP/1.1 200 OK Content-Length: 408 Accept-Ranges: bytes Vary: accept-encoding Server: Twisted/2.5.0 TwistedWeb/[twisted.web2, version 0.2.0] TwistedCalDAV/2.0 (unknown) Last-Modified: Sun, 22 Jun 2008 06:40:29 GMT DAV: 1, access-control, calendar-access, calendar-schedule, calendar-availability, inbox-availability, calendar-proxy, calendarserver-private-events ETag: "3DA7C8-BB0-485DDDD" Date: Sun, 22 Jun 2008 06:47:32 GMT Content-Type: text/calendar;charset=utf-8 Connection: close BEGIN:VCALENDAR VERSION:2.0 PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN BEGIN:VFREEBUSY UID:da987db656f77a5c73c73857ecbbfd60 DTSTART:20080620T070000Z DTEND:20080621T070000Z DTSTAMP:20080622T064732Z FREEBUSY;FBTYPE=BUSY:20080620T163000Z/20080620T173000Z,20080620T191500Z/20 080620T201500Z,20080620T213000Z/20080620T220000Z,20080620T233000Z/20080621 T000000Z END:VFREEBUSY END:VCALENDAR The only data that I want is the "FREEBUSY;FBTYPE=BUSY:20080620T163000Z/20080620T173000Z,20080620T191500Z/20 080620T201500Z,20080620T213000Z/20080620T220000Z,20080620T233000Z/20080621 T000000Z". Thank you for any help!
  2. Hello, I need some help parsing this XML file. The only data that I want to extract is he calendar-data section. I've tried some different things and the best I've been able to do is output the Keys but not that data within the keys. <?xml version='1.0' encoding='UTF-8'?> <multistatus xmlns='DAV:'> <response> <href>/calendars/users/XXXXX/calendar/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX.ics</href> <propstat> <prop> <getetag>\"93abc877951916fd12ab228f5a34e569\"</getetag> <calendar-data xmlns='urn:ietf:params:xml:ns:caldav'><![CDATA[bEGIN:VCALENDAR VERSION:2.0 PRODID:-//PYVOBJECT//NONSGML Version 1//EN BEGIN:VTIMEZONE TZID:US/Pacific BEGIN:STANDARD DTSTART:20071104T020000 RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU TZNAME:PST TZOFFSETFROM:-0700 TZOFFSETTO:-0800 END:STANDARD BEGIN:DAYLIGHT DTSTART:20070311T020000 RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU TZNAME:PDT TZOFFSETFROM:-0800 TZOFFSETTO:-0700 END:DAYLIGHT END:VTIMEZONE BEGIN:VEVENT UID:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX DTSTART;TZID=US/Pacific:20080501T130000 DTEND;TZID=US/Pacific:20080501T135000 EXDATE;TZID=US/Pacific:20080529T130000 RRULE:FREQ=WEEKLY;INTERVAL=2 SUMMARY:Staff Meeting END:VEVENT BEGIN:VEVENT UID:CD01072C-A77F-411A-8343-70AC2B293957 RECURRENCE-ID;TZID=US/Pacific:20080501T130000 DTSTART;TZID=US/Pacific:20080501T130000 DTEND;TZID=US/Pacific:20080501T135000 SUMMARY:Staff Meeting END:VEVENT END:VCALENDAR ]]></calendar-data> </prop> <status>HTTP/1.1 200 OK</status> </propstat> </response> </multistatus> Thank you!
  3. Yes I want to be able to remove all the headers and have only XML
  4. Hello, Lets say I have a variable that contains some text and xml. $file = "HTTP/1.1 207 Multi-Status Content-Length: 1341 Accept-Ranges: bytes Vary: accept-encoding Server: Twisted/2.5.0 TwistedWeb/[twisted.web2, version 0.2.0] TwistedCalDAV/2.0 (unknown) Last-Modified: Wed, 04 Jun 2008 21:18:37 GMT DAV: 1, access-control, calendar-access, calendar-schedule, calendar-availability, inbox-availability, calendar-proxy, calendarserver-private-events ETag: \"3D2D-594-484706AD\" Date: Wed, 04 Jun 2008 21:23:25 GMT Content-Type: text/xml Connection: close <?xml version='1.0' encoding='UTF-8'?> XML GOES HERE </multistatus>"; How do I strip out the text- from "HTTP/1.1 207 Multi-Status" to "Connection: close", including the blank line below connection close? Thanks
  5. I realize this may be a better post for the oop forum but I figured there is more visibility here. I have a class that outputs an .ics (iCal file) and I want to create multiple .ics files in the same page. I've setup a loop to create a new instance of the class but it creates one and then doesn't output anymore. I figure because its trying to instantiate the object with the same variable. Whats the best way to setup the loop so that I am creating new object on each loop? Thank you!
  6. I have a php file (call it file 1) that includes two other files (call them file 2 + 3). The file with the two other files I am including on other different pages, its for site statistics. But when I include file 1 to another page, it produces errors not able to find file 2 + 3. I understand that it doesn't know where to find them because I used relative paths for file 2 + 3 in file 1. Whats the best way to fix this problem? Thanks!
  7. Hello All, I'm am pulling a page with file_get_contents and I want to use preg_match to search the page to find the url that matches the STRING: <a href="http://www.example.com/[0-9][0-9][0-9][0-9]">STRING</a> So I have whatever STRING is, but I want to find the URL which has some numbers on the end of it, represented by the [0-9]*4 at the end of the example. Is preg_match the best for that? Regex is confusing me, I've tried a few things and they didn't seem to work. Any help is appreciated! Thank you!
  8. Hello all, I am trying to search a remote site for a string that is also a link, select the link and display the results. Is this easy to do? Thank you!
  9. Thank you for the help, Will I be able to use fopen/fwrite to insert some xml above the bottom element? Example: Heres my xml: <movielist> <movie name="Movie 1"> <id>0</id> <title>Movie 1</title> </movie> I want to insert new text here </movielist> Thank you for any help!
  10. Hello All, I have an xml file that I use to store information in. I want to be able to add info to it without deleting whats in the file. Thank you!
  11. I am trying to write a gallery script that will auto crop an image to make it look right in a specific size thumbnail. For example, If you have a picture that is 1024 x 768, it won't look right if you make it into a thumbnail (200 x 200) without cropping it. This is something that flickr does with all their thumbnails. I have no idea where to start. Thank you for any help!! -Chris
  12. Hello all, I would like php to execute terminal commands on the server (linux), I realize the potential security problems with this but it would be used primarily in a local environment. Thank you!
  13. You know what guys, I actually solved it. I really should have played around with it more before posting here. The array is just a bunch of integers. What I did: $result = mysql_query('SELECT * FROM db'); while ($row = mysql_fetch_array($result)) { if (in_array($row[id], $array)) { echo $row[id]; } }
  14. Hello JJohnsenDK, Thank you for the reply, I don't see how this would work with my array. For each row pulled from the DB, i would like it to search the array for that particular row. Any input is appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.