Convert history.plist file to XML + SAFARI

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Convert history.plist file to XML + SAFARI

 
0
  #1
May 20th, 2009
hi frnds, i want to get the safari history in VB.Net..Safari maintains its history in history.plist file.....I want to know that how to convert this file to XML format??Plz help me out from where to start,,,cz i have no idea..
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 115
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: Convert history.plist file to XML + SAFARI

 
0
  #2
May 21st, 2009
I don't use Safari but I have it installed (version 3.2.2 (525.28.1)). I took a quick look at history.plist and it looks like valid XML to me. I also changed the file extension to xml and it opened with my xml editor without errors.

Maybe you don't have to do any conversion at all? Have you tried reading it with VB.NET (XmlReader or whatever you want to do with the file)?
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Re: Convert history.plist file to XML + SAFARI

 
0
  #3
May 21st, 2009
Sorry its not History.plist file its Bookmarks.plist file,Its in binary format..open it .I want to convert it XML format so dat i can retch bookmarks from it......
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 115
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: Convert history.plist file to XML + SAFARI

 
0
  #4
May 21st, 2009
Bookmarks.plist seems valid XML too...
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Re: Convert history.plist file to XML + SAFARI

 
0
  #5
May 21st, 2009
No frnd bookmarks file is not in XML format......Cz XML file can be raed in simple format...

  1. If Dir(sFileName) <> "" Then
  2. FileOpen(FileNum, Application.StartupPath & "\" & IGNORE_LIST_PATH, OpenMode.Input, OpenAccess.Read, OpenShare.Shared)
  3. Do While Not EOF(FileNum)
  4. sInputLine = LineInput(FileNum)
  5. Loop
  6. End If

When i read the history.plist with the above code,it is raeding..But when i raed the Bookmarks.Plist file...It is raeding,but data returned is not correctly..
have a look again at the Boomarks,Plist..Althought u can view the view contents of the file. Plz raed the file U will come to know what i m sayg??
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 115
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: Convert history.plist file to XML + SAFARI

 
0
  #6
May 22nd, 2009
Worked fine with the following code. Never hit the "breakpoint" lines
  1. Dim sFileName As String
  2. Dim FileNum As Integer
  3. Dim sInputLine As String
  4.  
  5. sFileName = "C:\Documents and Settings\<user>\Application Data\Apple Computer\Safari\bookmarks.plist"
  6. FileNum = FreeFile()
  7. If Dir(sFileName) <> "" Then
  8. Try
  9. FileOpen(FileNum, sFileName, OpenMode.Input, OpenAccess.Read, OpenShare.Shared)
  10. Catch ex As Exception
  11. ex = ex ' Breakpoint line
  12. End Try
  13. Do While Not EOF(FileNum)
  14. Try
  15. sInputLine = LineInput(FileNum)
  16. Catch ex As Exception
  17. ex = ex ' Breakpoint line
  18. End Try
  19. Loop
  20. End If
  21.  
  22. ' Second way
  23. If My.Computer.FileSystem.FileExists(sFileName) Then
  24. sInputLine = My.Computer.FileSystem.ReadAllText(sFileName)
  25. End If
I also renamed again bookmarks.plist -> bookmarks.xml and opened it with my xml-editor w/o any problems i.e. the editor marked the content as valid xml.

Have you opened your bookmarks.plist with an hex-editor and checked for "binary" characters (except CR and/or LF chars)? Have you tried to open it with an xml editor? (There are freeware editors in the net if you don't have a suitable editor.)

Also, have you tried to read bookmarks.plist with XmlReader instead as a text file? You can google VB.NET+"how to read xml file" to get sample codes for that.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC