mIRC Home    About    Download    Register    News    Help

Print Thread
#161942 13/10/06 02:29 AM
Joined: Oct 2006
Posts: 3
A
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Oct 2006
Posts: 3
I was trying to do a script with sockets to detect in a forum when there is a new post and then it will post on the irc channel new pos detected by nick on section of the forum. I search all scripting forums but i dont find nothin like it. I think it need a timer to every 120 seconds to search the forum for new post. I need someone to help me with this i need it pls the info is:

Forum: xxx.future-fta.info (Change x to w)
Vbulletin
user:Fortest
pass:fortest1


<a href="hxxp://www.future-fta.info/Forums/search.php?do=getnew" target="_blank">hxxp://www.future-fta.info/Forums/search.php?do=getnew</a>

#161943 13/10/06 08:57 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Is this your forum? If so, probably the most useful method would be to put an RSS feed on your forum and then download one of the RSS scripts from mircscripts.org.


Invision Support
#Invision on irc.irchighway.net
#161944 14/10/06 01:49 AM
Joined: Oct 2006
Posts: 3
A
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Oct 2006
Posts: 3
Quote:
Is this your forum? If so, probably the most useful method would be to put an RSS feed on your forum and then download one of the RSS scripts from mircscripts.org.


Is not my forum the owner of that forum is a friend of mine and i dont like to ask him for that he know what i am doin but I willl like this to be Separated of the forum i wil not like if somethin happends to the forum crash or somethin i dont whant him to blame me for it.

This can be done coz i know some one that have it but he dont whant to help me with this coz he is oure Competition.

I need this pls help me with this thz

#161945 14/10/06 07:01 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
If he is your friend, you can still see if he'll run an RSS feed for the forum. FYI -- An RSS feed on the forum would be helpful for everyone who visits the forum and would like a quick method to see new information. It would be useful for him to add it, even if it wasn't to help you out.

If not, then you'll have to check the forum using sockets and watch for a change in the date, or a text that says there are new topics/posts.


Invision Support
#Invision on irc.irchighway.net
#161946 15/10/06 07:38 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019


Usage: /future-fta.check

The first time you call the alias, it has to login to retrieve necessary cookie information. After that, the cookie is stored, and used in subsequent calls.

Example: /future-fta.check Fortest fortest1

If you don't supply the username/password whilst you don't have a cookie, the script will ask for them with the use of an $input box.

Results (if any) are stored in hash table future-fta with items being an index number, and data being some relevant data about new posts, delimited by $chr(127). After running /future-fta.check, a signal event named "future-fta" will be triggered, which lets you know how many new posts were found. You can put custom code there to do whatever you wish to do with the results.

As an example, in the signal event I'm calling the alias future-fta.shownew which illustrates a possible usage.

If there are multiple pages with "new posts" (1 2...) it only checks the first one.

Do not bother asking me for anything else, or any amendments to the code, I'm not interested. I have quit scripting a long time ago, however was bored today so figured what the heck.

Code:
alias -l e echo -ac info * Future-FTA: $1-
 [color:red]  [/color] 
alias future-fta.check {
  if (!%future-fta.cookie) {
    if ($0 != 2) tokenize 32 $input(Please enter your username,eo) $input(Please enter your password,po)
    sockopen future-fta.login future-fta.info 80
    sockmark future-fta.login $1 $md5($2)
    e logging in to forum... please stand by.
  }
  elseif (%future-fta.lastcheck) {
    e The forum requires for you to wait atleast $ifmatch seconds before performing a new search.
  }
  elseif (!%future-fta.searchid) {
    sockopen future-fta.searchid future-fta.info 80
    sockmark future-fta.searchid do=getnew
    e retrieving a searchid in order to check new posts... please hold on.
  }
  else {
    .fopen -o future-fta.check tmp
    sockopen future-fta.check future-fta.info 80
    sockmark future-fta.check searchid= $+ %future-fta.searchid
    e checking for new posts on forums... this may take a while.
  }
}
 [color:red]  [/color] 
on *:sockopen:future-fta.*:{
  var %s = $sockname, %sw = sockwrite -tn %s
  if ($sockerr) { e Error connecting to $sockname $+ , please try again. | halt }
  if ($gettok(%s,2,46) == login) {
    tokenize 32 $sock(%s).mark
    var %data = $+(vb_login_username=,$1,&amp;cookieuser=1&amp;vb_login_password=&amp;s=&amp;do=login&amp;vb_login_md5password=,$2,&amp;vb_login_md5password_utf=,$2)
    %sw POST /Forums/login.php?do=login HTTP/1.0
    %sw Referer: http://www.future-fta.info/Forums/ 
    %sw Content-Type: application/x-www-form-urlencoded
    %sw Content-Length: $len(%data)
    %sw Host: www.future-fta.info   
    %sw
    %sw %data
  }
  else {
    %sw GET /Forums/search.php? $+ $sock(%s).mark HTTP/1.0
    %sw Cookie: %future-fta.cookie
    %sw Host: www.future-fta.info   
    %sw
  }
}
 [color:red]  [/color] 
on *:sockread:future-fta.*:{
  var %in, %s = $sockname, %type = $gettok(%s,2,46)
  if (%type == login) {
    sockread -f %in
    tokenize 32 $left(%in,930)
    if ($1 == Set-Cookie:) {
      %future-fta.cookie = %future-fta.cookie $2
    }
    elseif (* !iswm $1) {
      sockclose %s
      if (*bbuserid=*; bbpassword=* !iswm %future-fta.cookie) {
        e Incorrect username/password or an error has occured, please try again.
      }
      else future-fta.check
    }
  }
  elseif (%type == searchid) {
    sockread -f %in
    if (!%future-fta.searchid) &amp;&amp; ($regex(%s,%in,/URL=http\S+?searchid=(\d+)/)) {
      sockclose %s
      %future-fta.searchid = $regml(%s,1)
      future-fta.check
    }
  }
  else {
    sockread &amp;in
    while ($sockbr) {
      .fwrite -b %s &amp;in
      sockread &amp;in
    }
  }
}
 [color:red]  [/color] 
on *:sockclose:future-fta.check: {
  .fclose $sockname
  unset %future-fta.searchid
  set -z %future-fta.lastcheck 110
  future-fta.parse
}
 [color:red]  [/color] 
alias future-fta.parse {
  var %size = $file(tmp), %pos = 1, %id = future-fta, %i = 1, %t
  if (!%size) { e no data was saved to tmp file. | return }
  bread tmp 0 %size &amp;in
  if ($hget(%id)) hfree %id
  hmake %id
  while ($bfind(&amp;in,%pos,id="thread_title_)) {
    %pos = $v1
    %t = $regex(a,$bvar(&amp;in,%pos,930).text,/:bold"&gt;(.+?)&lt;.+?title="Replies: (\d+)\54 Views: (\d+).+?white-space:nowrap"&gt; (\S+) &lt;span class="time"&gt;(.+?)&lt;/span&gt;/i)
    inc %pos $regml(a,5).pos
    %t = $regex(b,$bvar(&amp;in,%pos,930).text,/by &lt;a href=.+?&gt;(\S+?)&lt;.+?forumdisplay.+?&gt;(.+?)&lt;/a&gt;/i)
    %t = $chr(127)
    hadd %id %i $+($regml(b,2),%t,$regml(a,1),%t,$regml(a,3),%t,$regml(a,2),%t,$regml(b,1),%t,$regml(a,4) $regml(a,5))
    inc %i
  }
  .signal %id $calc(%i -1)
}
 [color:red]  [/color] 
on *:signal:future-fta:{
  e Found $1 new posts, stored in hash table future-fta
  future-fta.shownew
}
 [color:red]  [/color] 
alias future-fta.shownew {
  var %a = 1
  while ($hget(future-fta,%a)) {
    tokenize 127 $ifmatch
    echo -a # $+ %a
    echo -a Forum: $1
    echo -a Thread: $2
    echo -a Views: $3 - Replies: $4
    echo -a Last post by: $5, $6
    echo -a 
    inc %a
  }
}


Gone.
#161947 17/10/06 06:45 PM
Joined: Oct 2006
Posts: 3
A
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Oct 2006
Posts: 3
Thz bro is working very good but I have to change it a litle t i am trying to find someone to help me but noen can do itwhen you get bore again pls tell me. The script is working very good but i will like to only veryfy if there is a new post and then post it on the channel like this:
Code:
New post detected on Forum: Applications &amp;amp; Operating Systems, Thread: Shared software, Views: 2 - Replies: 11, Last post by: freedom76, Today 01:42 AM, LInk www.future-fta.info/Forums...

The link is missing and it post all the new post of that page like 25 i change is a little from echo to msg but is post all 25 in the channel i want it to only post in the channel if there is any new post. Verify every 2 min then check if there is any change in the ilatest post then post the info like i just show you whith the link so the people can dobble click on it and go to that latest post.

Well i try not to ask you for help coz you are retired from this but I ask a bunch of people and none can help me. I put the timer and the msg but is not working like i whant so when you ge bored again pls help me with this.

Sry for my englich ths is not my first language confused

alphaIRC #177136 20/05/07 03:35 PM
Joined: May 2007
Posts: 1
B
Mostly harmless
Offline
Mostly harmless
B
Joined: May 2007
Posts: 1
hi all,

I was wondering if someone could help me out with this script that FiberOPtics has made. i am using this script for a similar web page, and only changed the info required for web page and it works great. The problem i am having as the guy alpha said is figureing out how to add it to echo the link (html address) to the new post.


If anyone can help i would greatly appreciate it. Thanks.


Link Copied to Clipboard