Author Topic: issue: %search% with space  (Read 11213 times)

Offline chip!

  • Bad Ass
  • Administrator
  • Unstoppable
  • *****
  • Posts: 2301
  • Karma: +629/-6
    • View Profile
issue: %search% with space
« on: April 15, 2013, 02:19:06 am »
appears some times having a space in the %search% needs to be translated to %20 instead of "+"
  -  https://convivea.com  -   And...  boom goes the dynamite.

Offline Bovski

  • Head Cider Tester
  • Hero Member
  • *****
  • Posts: 673
  • Karma: +189/-0
  • High Five Me
    • View Profile
    • Warez The Index
Re: issue: %search% with space
« Reply #1 on: April 16, 2013, 04:54:46 am »
Yes some times it does I have mentioned we need to be able to manipulate the %search% and even the whole line some sites allow for tittle or description searches so we need to modify the string to match if the user has selected "Include description searches"

Offline chip!

  • Bad Ass
  • Administrator
  • Unstoppable
  • *****
  • Posts: 2301
  • Karma: +629/-6
    • View Profile
Re: issue: %search% with space
« Reply #2 on: April 16, 2013, 12:26:27 pm »
i gotcha..    do you have any site examples where the search is changed for description searches so I can start to conceptualize on how to change the script structure?  for example, code0 is already dedicated to prelogin processing, but to your point, seems like we need a "pre-connection" code section prior to any http requests..

just brainstorming.. lets say a flag 0 or 1 is passed to this function based on whether 'description searches' are checked ($descriptions).. then an  IF  THEN section can be processed to manipulate %search%.. hmm..
  -  https://convivea.com  -   And...  boom goes the dynamite.

Offline chip!

  • Bad Ass
  • Administrator
  • Unstoppable
  • *****
  • Posts: 2301
  • Karma: +629/-6
    • View Profile
Re: issue: %search% with space
« Reply #3 on: April 16, 2013, 06:06:40 pm »
i'm exposing @profile  (search URL), @search  (search terms) , and $desc (1 if include description searches, 0 if not) to the script engine.. and also added ability for ['code] section to be processed before launching any http connection..   more to come later.
  -  https://convivea.com  -   And...  boom goes the dynamite.

Offline chip!

  • Bad Ass
  • Administrator
  • Unstoppable
  • *****
  • Posts: 2301
  • Karma: +629/-6
    • View Profile
Re: issue: %search% with space
« Reply #4 on: April 17, 2013, 04:08:35 pm »
Bovski, CuF.. hopefully you guys can review and let me know if you have any concerns or suggestions on these engine changes :)

ok.. made some changes i think should work. added a new script header flag "initialize=1" which will trigger the code section labeled [initialize] to be processed before any searching.  this allows you to modify any of the search variables, including new @search, @profile and also use the read-only $descriptions.  

side note, also fixed
-the redirect '//' bug for toggling same HTTP or HTTPS protocol as the referrer
-'Locate' button in the script debugger for 'find() and extract()'
-properly urlencode the @search (uses Win32 API.. so for example " " is converted to "%20" instead of "+"... also takes care of all the other characters)


Code: [Select]
[script]
name=HDbits.org
source=HDbits
author=CuF
modified=CuF 2013/01/28, chip 2013/04/17
pwd=1
version=2
initialize=1

[home]
1=https://hdbits.org

[profiles]
all=/browse.php?incldead=0&search=%SEARCH%
video=/browse.php?c3=1&c4=1&c1=1&c5=1&c2=1&incldead=0&search=%SEARCH%
audio=/browse.php?c6=1&incldead=0&search=%SEARCH%

[login]
prelogin=code(`/login?returnto=%2F`,0)
login=https://hdbits.org/login/doLogin
form=uname=%USER%&password=%PASS%&lol=%LOL%
failed=Type in your username and password
failed2=action="/login/doLogin"

[initialize]
@search=put(`new test search`)
if ($descriptions=1) then
@profile=&(@profile,`&incdes=true`)
end if
[/initialize]

[code0]
@i=find(@i,@data,`name="lol"`,`value=`)
num=extract(@i,@data,`"`,`"`)
$form=replace($form,`%LOL%`,num)
[/code0]

[code1]
x=findh(x,@data,`Upped&nbsp;by`,`<tr`)
z=find(x,@data,`</table>`)
@data=crop(@data,x,z)
@data=vacuum(@data)
@data=replace(@data,`<br />`,` `)
@r=split(@data,`</tr>`)

start
@q=split(@r,`</td>`)
t=array(@q,2)
@i=find(@i,t,`href=`)
$page=extract(@i,t,`"`,`&`,`https://hdbits.org`)
$name=extract(@i,t,`>`,`<`)
@i=find(@i,t,`href=`)
$torrent=extract(@i,t,`"`,`"`,`https://hdbits.org/`)
$date=array(@q,4)
$size=array(@q,5)
$seeds=array(@q,7)
$leeches=array(@q,8)

aloop
[/code1]
« Last Edit: April 17, 2013, 04:12:20 pm by chip! »
  -  https://convivea.com  -   And...  boom goes the dynamite.

Offline chip!

  • Bad Ass
  • Administrator
  • Unstoppable
  • *****
  • Posts: 2301
  • Karma: +629/-6
    • View Profile
Re: issue: %search% with space
« Reply #5 on: April 17, 2013, 04:49:18 pm »
  -  https://convivea.com  -   And...  boom goes the dynamite.