Advertisement:

Author Topic: Forum Spy  (Read 19492 times)

Offline wk38

  • Jr. Member
  • **
  • Posts: 185
Forum Spy
« on: May 22, 2007, 07:41:36 PM »
This is kind of cool. Would be fun to have something like this for SMF.

http://www.rcgroups.com/forums/announcement.php?f=128

Offline littlefeather

  • Semi-Newbie
  • *
  • Posts: 27
  • Gender: Female
Re: Forum Spy
« Reply #1 on: May 22, 2007, 08:06:52 PM »
that is very cool... it would be nice if this could be put in mod or feature requests, because this is something I would definitely put in my forums

Offline H

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,656
  • Gender: Male
Re: Forum Spy
« Reply #2 on: May 23, 2007, 05:33:35 PM »
As a mod maybe.

IMO it is rather useless as most boards are small so it would basically be a static list anyway :P
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: Forum Spy
« Reply #3 on: May 23, 2007, 10:41:05 PM »
I don't think it would be terribly difficult to code... most of it is Javascript based on RSS feeds... and since SMF already has RSS feeds, and the Javascript could probably be easily modified from that.............

Maybe in a few weeks if I'm looking for something to have some fun with :)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline khoking

  • Jr. Member
  • **
  • Posts: 323
  • Gender: Male
    • ShaShinKi.com
Re: Forum Spy
« Reply #4 on: May 23, 2007, 11:05:58 PM »
That is very cool for a forum with lots of posts on every second or minute...mine not yet reach that stage...but still I would like to have this mod. :P

No, don't name the mod as SPY as it doesn't sound "safe" to members...

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Forum Spy
« Reply #5 on: May 24, 2007, 03:11:44 AM »
This looks quite interesting, I'll see if I can code up something similar (as usual, no promises!).
Basically, it checks an XML feed every 15 seconds, for any new posts. If there's some new posts, they're added to the table (one entry each second, so people don't get overwhelmed with posts flooding in :P). As SMF already has an XML feed inbuilt, this would be almost entirely client-side.

« Last Edit: May 24, 2007, 03:13:45 AM by Daniel15 »
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Rudolf

  • SMF Hero
  • ******
  • Posts: 1,934
  • Gender: Male
  • iamanoompaloompa
Re: Forum Spy
« Reply #6 on: May 24, 2007, 03:18:53 AM »
Daniel, if you do write something like this, make sure to add a setting for the update frequency. Since this is ajax, you can even add a way to shape the frequency based on the server load, dynamically. The higher the load the slower the update time.
Without this feature this would make the servers to crawl even on the small-medium forums - if the users start to use it.

Hints: What happens when the number of returned topics is greater then 15 sec. The script is still loading up the topics in the table and a new request will be made. This would cause some parallel insertions, a total mess. Therefore, you need to write your script to don't send an update request only when the "cache" is empty.

Two, I haven't looked at the other script to see how it handles the topic queue, but topics that go over the bottom of the table should be removed from the page. Think DOM. ;)

That's it for now.
« Last Edit: May 24, 2007, 03:24:47 AM by Rudolf »
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Forum Spy
« Reply #7 on: May 24, 2007, 04:39:53 AM »
Quote
Hints: What happens when the number of returned topics is greater then 15 sec. The script is still loading up the topics in the table and a new request will be made. This would cause some parallel insertions, a total mess.
I think it uses a queue - When a new request is made, all the new posts are pushed to the end of the queue.
I haven't looked through that code properly yet, but I may use it as inspiration (I never copy-and-paste code from someone else, I just use their code as inspiration for my own :)). I saw that they're using a JavaScript library (Prototype.js, I think... I'd personally use Scriptaculous or mootools :))
« Last Edit: May 24, 2007, 04:45:33 AM by Daniel15 »
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Harro

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,122
  • Gender: Male
  • I'm watching you
    • Forum Affiliates Network
Re: Forum Spy
« Reply #8 on: May 24, 2007, 04:49:40 AM »
Also take a look at jQuery.
http://jquery.com
http://visualjquery.com

That's a javascript library i've been using lately.
Kinda like it :)

Community for forum admins            
The place for forum Advice & post exchanges!!!
No PM's for support. Will be ingnored and I'll steal your cookies!


Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Forum Spy
« Reply #9 on: May 26, 2007, 03:02:12 AM »
OK, to see what I've done so far, take a look at http://rpl.dev.dansoftaustralia.net/smf/index.php?action=recentlive. It initially loads the latest 5 posts into the list, and then checks every 10 seconds for new ones. Open that page in a new browser window/tab, and then make a new topic (you may login with the username and password of "test"). After a few seconds, you'll see your new post appear in the list :).
You can get the code from its SVN repository (http://dev.dansoftaustralia.net/scm/?group_id=23), but there's no guarantees it will work for you (and I'm not giving any support yet). If you have any suggestions, please tell me :D

Quote
That's a javascript library i've been using lately.
Kinda like it
Looks nice, I may consider using it.
The only libraries I'm familiar with at the moment are Scriptaculous (which uses Prototype.js) and mootools. I love mootools because it's so lightweight (5 - 40 KB packed, depending on the options you choose when downloading it).
« Last Edit: May 26, 2007, 03:17:02 AM by Daniel15 »
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: Forum Spy
« Reply #10 on: May 26, 2007, 05:54:26 AM »
It gives me an error in IE7 when i try to see you demo !

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Forum Spy
« Reply #11 on: May 26, 2007, 07:52:15 AM »
It gives me an error in IE7 when i try to see you demo !
What errors are you getting?
Sorry, I could not test it in IE7, as I do not have Windows installed at the moment (I use Linux).
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: Forum Spy
« Reply #12 on: May 26, 2007, 08:40:31 AM »
base2 is my library of choice ;)
Are you doing this poll based, or Comet based?
« Last Edit: May 26, 2007, 08:42:48 AM by eldʌkaː »
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Forum Spy
« Reply #13 on: May 26, 2007, 10:48:12 AM »
Currently, it's poll-based. I'd probably have problems with timeouts and such if I tried to make it Comet-based ;).
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,584
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: Forum Spy
« Reply #14 on: May 26, 2007, 11:21:15 AM »
yes daniel, I get the error too on IE7



Works fine in Firefox for me!

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Forum Spy
« Reply #15 on: May 26, 2007, 11:59:12 AM »
OK, I'll take a look at it when I have access to a Windows PC :).
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: Forum Spy
« Reply #16 on: May 26, 2007, 08:39:27 PM »
i get no error, using firefox, on a windows based PC

another IE7 glitch :P

This mod is awesome, awesome work daniel15!
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

Quote
Microsoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"

Useful Links:
Online Manual!
How to Help us Help you   
Search
Settings Repair Tool
     

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Forum Spy
« Reply #17 on: May 26, 2007, 10:24:38 PM »
yes daniel, I get the error too on IE7



Works fine in Firefox for me!
Was that the full error message? Line 42 on the page itself is unrelated, and line 42 in rpl.js is blank :o.
I'll install my copy of Windows XP into a virtual machine later, download IE7, and see what I can do to fix it ;)

Quote
This mod is awesome, awesome work daniel15!
Thanks :D

As usual, I'll only release it once I've finished with it, and have time to... This may not be for a while (mid-year exams coming soon!)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Dannii

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,211
  • Mind the volcano!
    • My homepage
Re: Forum Spy
« Reply #18 on: May 27, 2007, 03:48:31 AM »
Currently, it's poll-based. I'd probably have problems with timeouts and such if I tried to make it Comet-based ;).
Apache sucks for Comet too. Polls can work okay, just make sure the footprint is low ;)
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,216
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Forum Spy
« Reply #19 on: May 27, 2007, 04:27:24 AM »
Currently, it's poll-based. I'd probably have problems with timeouts and such if I tried to make it Comet-based ;).
Apache sucks for Comet too. Polls can work okay, just make sure the footprint is low ;)
Yeah, I'm working on that. Currently it just grabs the XML feed with the 5 latest posts, which is really not needed (and wastes a little bandwidth). I'm going to modify the XML functions to accept a message ID (like ?action=.xml;last_msg=12), and only all messages newer than this are returned. This would make the footprint really small :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!