In an effort to relieve some of the [url=http://www.bungie.net/Forums/posts.aspx?postID=63693482]depression[/url] around here, I figured I'd this might be something people would be interested in.
Some of you know about the mobile site I wrote up site [url=http://bnetmobile.site90.net/]over here[/url]. There is stuff going on behind the scenes there which converts a regular page on bungie.net to one of the equivalent ones you see on that site. What I'd like to share with everyone is the "stuff" which does that.
[url]http://www.megaupload.com/?d=B807RYCC[/url]
What it does: As an example, the [url=http://pastebin.com/g8LCvHza]HTML of the Community forum[/url], when fed into the "stuff", produces [url=http://pastebin.com/cjQQy0UX]a number of objects[/url] for programmatic access.
Download is a standard .zip file which contains 14 .php scripts (or simply text files for the layperson). All of them contain class or interface definitions. Only one method performs I/O - BungieNetPost::ResolvePostID - which is a HEAD request to Bungie.net using cURL (it isn't called anywhere in any class file). Otherwise, none of the scripts will write or read.
Example usage:[quote]function __autoload($className){
require_once("../classes/" . $className . ".php");
}
$f = new BungieNetForum(file_get_contents("http://www.bungie.net/Forums/topics.aspx?forumID=3"));
var_dump($f);
$t = new BungieNetTopic(file_get_contents("http://www.bungie.net/Forums/posts.aspx?postID=15804986"));
var_dump($t);
$p = new BungieNetUser(file_get_contents("http://www.bungie.net/Account/Profile.aspx?memberID=2758679"));
var_dump($p);[/quote]
Few notes:
- Tested on PHP 5.3.3 (earlier versions may have "difficulties").
- If you don't like the way things are parsed, you're welcome to change it.
- Some of the properties may/may not be used (if ever). Remember: what the scripts can access is dependent on what bungie.net makes available through HTML, so a lot of the time things will be null.
- From the example above, it can parse a forum, topic, or profile page, but a lot of what's in there can probably be reused for other things (eg. inbox, private group forums, etc...).
Standard/Obvious disclaimer: Use at your own risk. I am not responsible in any way for how you use what's provided (eg. getting yourself IP banned).
Have fun!
-
It's times like this I wish I was more knowledgeable in the scripting, programming, ways. Looks incredible interesting though.
-
[quote][b]Posted by:[/b] Steelflex It's times like this I wish I was more knowledgeable in the scripting, programming, ways. Looks incredible interesting though. [/quote] Just what I was thinking.
-
So exactly what can we do with this? (graphically or code-wise, I only know basic PHP)
-
[quote][b]Posted by:[/b] Steelflex It's times like this I wish I was more knowledgeable in the scripting, programming, ways. Looks incredible interesting though. [/quote] That's what I was going to say... Good thing I'm going to take some classes on these types of things.
-
Thread saved, for when I get to finally have some free time and learn some programming. ... >_> <_<
-
Stupid trend micro security saying that it is a dangerous link. Thanks dazarobbo for screwing with my internet security :]
-
Looks complicated, but interesting. Very interesting.
-
[quote][b]Posted by:[/b] dazarobbo Have fun![/quote]Thanks for sharing.
-
[quote][b]Posted by:[/b] Count Blinkula So exactly what can we do with this? (graphically or code-wise, I only know basic PHP)[/quote]Use it as a basis for making things. For example, you could fairly easily make something that looks through the contents of each post in each thread in each forum and searches for your username (assuming no "interruptions", so-to-speak). Or make a better mobile site - that couldn't be too difficult :P
-
In english daz?
-
that all looks cool, if only i understood it :p
-
[quote][b]Posted by:[/b] dazarobbo [quote][b]Posted by:[/b] Count Blinkula So exactly what can we do with this? (graphically or code-wise, I only know basic PHP)[/quote]Use it as a basis for making things. For example, you could fairly easily make something that looks through the contents of each post in each thread in each forum and searches for your username (assuming no "interruptions", so-to-speak). Or make a better mobile site - that couldn't be too difficult :P[/quote] Got to admit you are pretty good with assisting people with connection and computer problems I take it you have a computing or engineering degree of some kind? Anyway nice thread, but what would cause you to get IP banned while using this? (apologies my computing skills are as bad as anyone I have ever met
-
You would likely get IP banned if you made too many requests to bungie.net, especially within a short amount of time, as the server(s) would probably see it as a DoS.
-
[quote][b]Posted by:[/b] dazarobbo You would likely get IP banned if you made too many requests to bungie.net, especially within a short amount of time, as the server(s) would probably see it as a DoS.[/quote] I think I'll stick with science :] Thanks anyway dazarobbo
-
Awesome! Thanks for sharing. This looks really useful.
-
It would be nice if Bungie offered a public read-only mirror of their DB.
-
Nice, I now have the tools to start my b.net title booster bot! A few n-gram classifications, a Bayesian filter, and I am set!
-
I'll start playing around with this soon, thanks dazarobbo; I've seriously been looking for something like this.
-
Cool. Sucks that this thread didn't get a lot of attention.
-
Crap. Now I must learn PHP. But where?
-
[url=http://www.w3schools.com/php/default.asp]Great site.[/url] [quote][b]Posted by:[/b] giggybyte Crap. Now I must learn PHP. But where?[/quote] [Edited on 08.13.2011 8:35 AM PDT]
-
This would be a good start for learning how to program! Thanks.
-
[quote][b]Posted by:[/b] giggybyte Crap. Now I must learn PHP. But where?[/quote] [url]http://php.net[/url] [quote][b]Posted by:[/b] dazarobbo[/quote] That's some pretty cool -blam!- there. I wish I had more time to look over it, maybe when uni starts back and all these exam resists are over :( ps. DomDocument <3
-
'Robbo, I think it's time you learned how to use an SCM. I mean, packaging source code in a zip file... on MegaUpload? Really? Come on, now. You should learn an SCM tool like [url=http://mercurial.selenic.com/]Mercurial[/url] or [url=http://git-scm.com/]Git[/url], and then put your code up on [url=http://bitbucket.org/]BitBucket[/url], [url=http://github.com/]GitHub[/url], or [url=http://code.google.com/]GoogleCode[/url]. And if using an SCM system doesn't fancy you, the least you could do is use a file upload service like [url=http://www.filedropper.com/]FileDropper[/url], instead of the abomination that is MegaUpload. I like cats.
-
I thought this said "laser project". *leaves disappointed*
-
[quote][b]Posted by:[/b] Zealot Tony [quote][b]Posted by:[/b] dazarobbo You would likely get IP banned if you made too many requests to bungie.net, especially within a short amount of time, as the server(s) would probably see it as a DoS.[/quote] I think I'll stick with science :] Thanks anyway dazarobbo[/quote] Yup.