Sub ExtraireURL_History_FireFox()
Dim CibleLigne As String
Dim Fichier As String, Resultat As String
Dim Valeur As Double
Dim Place As Double, Fin As Double, Debut As Double
Dim x As Double, y As Double
Dim i As Integer
Fichier = "C:\Documents and Settings\...\Firefox\...\history.dat"
Open Fichier For Input As #1
Valeur = FileLen(Fichier)
CibleLigne = Input(Valeur, 1)
Close 1
Debut = 1
Do While InStr(Debut, CibleLigne, "http") <> 0
Place = InStr(Debut, CibleLigne, "http")
Fin = InStr(Place, CibleLigne, ")")
Resultat = Replace(Replace(Mid(CibleLigne, Place, Fin - Place), _
vbCrLf, ""), "\", "")
If InStr(1, Resultat, "pagead2.googlesyndication.com") = 0 Then
i = i + 1
'place les Url dans la Feuil2
Worksheets("Feuil2").Cells(i, 1) = Resultat
x = InStr(Fin, CibleLigne, "=")
y = InStr(x, CibleLigne, ")")
If IsNumeric(Mid(CibleLigne, x + 1, y - x - 1)) Then _
Worksheets("Feuil2").Cells(i, 2) = _
Timestamp_to_Date(Left(Mid(CibleLigne, x + 1, y - x - 1), 10), 1970)
End If
Debut = Fin
Loop
Columns("A:B").AutoFit
End Sub
Function Timestamp_To_Date(TimeStamp As Double, Annee As Double) As Date
Dim DebutAnnee As Date
DebutAnnee = CDate("01/01/" + Cstr(Annee))
Timestamp_to_Date = DateAdd("s", TimeStamp, DebutAnnee)
End Function