BinaryWorks.it Official Forum
BinaryWorks.it Official Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 eXtreme Movie Manager (Rel. 7), No More Updates
 Bug Report
 Magic Script Bug?
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2 Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JDommi
Administrator

Germany
4638 Posts

Posted - 07 Apr 2011 :  10:01:30  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Well, haven't done such thing in VB but isn't it that simple
Dim inputData As String = "[search-term]"
Dim postData As String = "param1=" + inputData
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded"
Dim response As String = Encoding.UTF8.GetString(myHttpWebRequest.UploadData(url , "POST", Encoding.UTF8.GetBytes(postData)))

As WShell-Script I only have used this code, but it opens an IE window.
On Error Resume Next

strURL = "http://www.cover-paradies.to/?Module=SimpleSearch"

param2 = WScript.Arguments(0)
param3 = WScript.Arguments(1)

Set IE_Instanz = CreateObject("InternetExplorer.Application")
Do While IE_Instanz.Busy
Loop

IE_Instanz.Visible = 1
IE_Instanz.Navigate strURL
Do While IE_Instanz.ReadyState <> 4
Loop

Set IE_Doc = IE_Instanz.Document
IE_Doc.all.Page.value = "0"
IE_Doc.all.SearchString.value = param2
IE_Doc.all.Sektion.value = param3
IE_Doc.all.B1.Click

Set IE_Doc = Nothing
Set IE_Instanz = Nothing

in VBNet
Dim req As Net.HttpWebRequest
        Dim resp As Net.HttpWebResponse
        Dim str, str2 As IO.Stream
        Dim cookies As Net.CookieContainer
        Dim buffer As String

        Dim data As Byte() = System.Text.Encoding.ASCII.GetBytes(*postdata*)

        req = Net.WebRequest.Create(url)
        req.CookieContainer = cookies
        req.Method = "POST"
        req.Accept = "*/*"

        req.Headers.Add(Net.HttpRequestHeader.AcceptLanguage, "de")
        req.Headers.Add("UA-CPU", "x86")
        req.Headers.Add(Net.HttpRequestHeader.AcceptEncoding, "gzip, deflate")

        'Fürn Post Request den ContentType & Lenght + Data

        req.ContentType = "application/x-www-form-urlencoded"
        req.ContentLength = data.Length

        str2 = req.GetRequestStream()
        str2.Write(data, 0, data.Length)
        str2.Close()

        resp = req.GetResponse
        str = resp.GetResponseStream()

        If (resp.ContentEncoding.ToLower().Contains("gzip")) Then
            str = New IO.Compression.GZipStream(str, IO.Compression.CompressionMode.Decompress)
        ElseIf (resp.ContentEncoding.ToLower().Contains("deflate")) Then
            str = New IO.Compression.DeflateStream(str, IO.Compression.CompressionMode.Decompress)
        End If

        buffer = New IO.StreamReader(str, System.Text.Encoding.ASCII).ReadToEnd 'only for ASCII

In order to achieve what is possible, you have to try the impossible over and over again.
Hermann Hesse

Edited by - JDommi on 07 Apr 2011 12:07:31
Go to Top of Page

Alessio Viti
Forum Admin

Italy
9171 Posts

Posted - 07 Apr 2011 :  16:36:07  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you JDommi!

XMM is write in vb .net... I will make some test and let you know.

So, for cover paradies for example we need the url and the postdata, right? so I have to add a new variable to script to store these info.

Or maybe I can add just an option to enable the use of POST and use the

#USEPOST#=1
#SCRIPTWEBSITE#=http://www.cover-paradies.to/?Module=SimpleSearch
for the website, and then

#WEBQUERY#

for the post data

Sorry... do you know exactly what is the postdata string to use with cover paradies?

Ale


http://www.facebook.com/pages/eXtreme-Movie-Manager/47220214342?ref=mf
Go to Top of Page

Prinz
Senior Member

Germany
1522 Posts

Posted - 07 Apr 2011 :  17:16:59  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You don't need post data for that site. Just use the extended search:

Example:

http://cover-paradies.to/?Module=ExtendedSearch&SearchString=Battle+Los+Angeles&StringMode=All


The Post Data for the simple search url http://cover-paradies.to/?Module=SimpleSearch would be:

Page=0&SearchString=Battle+Los+Angeles&Sektion=&B1=Search%21

Edited by - Prinz on 07 Apr 2011 17:29:59
Go to Top of Page

JDommi
Administrator

Germany
4638 Posts

Posted - 07 Apr 2011 :  18:13:59  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I know that cover-paradies doesn't need the post command. The code is a really old example for "POST".

@Ale: there are needed two numbers. The exact values I will send to you tomorrow (I'm @work at the moment)

In order to achieve what is possible, you have to try the impossible over and over again.
Hermann Hesse
Go to Top of Page

JDommi
Administrator

Germany
4638 Posts

Posted - 08 Apr 2011 :  08:34:05  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ah, Thx Prinz!
And here is the full list for the search sections (parameter 3) last time I used it:
quote:
' *****************************************
' Sektionen:
' *****************************************
' Sonstige
' "" ->Alle Kategorien
' "9" ->XXX
' Audio
' "2" ->Audio-CD
' "10" ->Audio-DVD
' "16" ->Audio-VHS
' "18" ->Kasette
' "19" ->Audio-SVCD
' "5" ->Audio-Maxi-CD
' "12" ->Hörspiele
' "13" ->Vinyl
' Filme
' "1" ->Video-SVCD
' "3" ->Video-DVD
' "11" ->Video-VHS
' "15" ->Video-DivX
' "17" ->Dokumentation
' "6" ->Serien
' "33" ->HD-DVD
' "32" ->Blue Ray
' Spiele
' "4" ->PC-Games
' "8" ->PS1
' "7" ->PS2
' "31" ->PS3
' "20" ->X-Box
' "29" ->X-Box 360
' "21" ->Gamecube
' "22" ->UMD
' "30" ->Wii
' Programme
' "14" ->PC Programme
' *****************************************

In order to achieve what is possible, you have to try the impossible over and over again.
Hermann Hesse
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic   Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BinaryWorks.it Official Forum © Binaryworks.it Go To Top Of Page
Generated in 0.14 sec. Powered By: Snitz Forums 2000 Version 3.4.07