[QUOTE=andersonmat;23483885]I've written my own version that mimics closely what Steam does to notify you. Is that a good idea?[/QUOTE]
That's pretty much what growl is, except growl is customizable, and it's piss easy to implement.
Also, 1.1 with growl.
If people still have random crashes, I'm going to do a debug spam edition.
[editline]10:54PM[/editline]
I posted about it and forgot the link.
[url]http://filesmelt.com/dl/Facepunch_Ticker3.zip[/url]
I can guarantee that my u/n and p/w are right, but it says 'Login failed'.
[editline]09:34PM[/editline]
And [code]See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
at System.Linq.Enumerable.<CastIterator>d__aa`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at FPTickerNotice.FilterSettings.LoadRule(Rule rule)
at FPTickerNotice.FilterSettings.ListBox1SelectedValueChanged(Object sender, EventArgs e)
at System.Windows.Forms.ListControl.OnSelectedValueChanged(EventArgs e)
at System.Windows.Forms.ListBox.OnSelectedValueChanged(EventArgs e)
at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ListBox.ObjectCollection.SetItemInternal(Int32 index, Object value)
at System.Windows.Forms.ListBox.ObjectCollection.set_Item(Int32 index, Object value)
at FPTickerNotice.FilterSettings.Button3Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)[/code]
When trying to save a filter.
[QUOTE=Agent766;23485233]I can guarantee that my u/n and p/w are right, but it says 'Login failed'.
[editline]09:34PM[/editline]
And [code]See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
at System.Linq.Enumerable.<CastIterator>d__aa`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at FPTickerNotice.FilterSettings.LoadRule(Rule rule)
at FPTickerNotice.FilterSettings.ListBox1SelectedValueChanged(Object sender, EventArgs e)
at System.Windows.Forms.ListControl.OnSelectedValueChanged(EventArgs e)
at System.Windows.Forms.ListBox.OnSelectedValueChanged(EventArgs e)
at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ListBox.ObjectCollection.SetItemInternal(Int32 index, Object value)
at System.Windows.Forms.ListBox.ObjectCollection.set_Item(Int32 index, Object value)
at FPTickerNotice.FilterSettings.Button3Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)[/code]
When trying to save a filter.[/QUOTE]
It's interesting how it didn't launch my exception handler. That said, I didn't bother to retest that part! Awesome.
[editline]12:51AM[/editline]
I see the bug as well.
[editline]01:49AM[/editline]
Found a few more bugs, will release whenever I get up.
[QUOTE=ShaRose;23484084]That's pretty much what growl is, except growl is customizable, and it's piss easy to implement.
[/QUOTE]
But they also have to install it. If you write it yourself, you have complete control over it and you don't have to worry about a user having something installed. It may take you another couple hours but it'd be more satisfying in my opinion to have something that you've made that does exactly what needs to be done.
[QUOTE=andersonmat;23487392]But they also have to install it. If you write it yourself, you have complete control over it and you don't have to worry about a user having something installed. It may take you another couple hours but it'd be more satisfying in my opinion to have something that you've made that does exactly what needs to be done.[/QUOTE]
I've got mixed opinions about this stuff, but in this case, the more things that rely on Growl the better, as more people will have it installed and it'll be less of an issue.
It'll also mean that the app is free to worry about what notifications to display and not how to display them in order not to conflict with anything else.
[QUOTE=andersonmat;23487392]But they also have to install it. If you write it yourself, you have complete control over it and you don't have to worry about a user having something installed. It may take you another couple hours but it'd be more satisfying in my opinion to have something that you've made that does exactly what needs to be done.[/QUOTE]
That's why I wrote my own first.
I'm using growl now because it looks better, it uses less resources, and it also behaves better than something I could do, both in usage and in customization.
I prefer to use what's best for the job, which is why when I found that webclient was doing a load of unneeded calls and slowing the ticker down, I wrote my own (VERY specific) http parser, if it can even be called that. I also wanted for a while to write my own version of controls so I would not need to reference system.windows.forms in the ticker library as well for threading. (I still have that project open, and I might finish it some day.)
Testing now.
[url]http://filesmelt.com/dl/Facepunch_Ticker4.zip[/url]
Fixed the filter thing that I forgot to bother to test.
Also, I fixed the login method in two ways, both stupid errors by me. So stupid I'll go a bit in depth:
For the login, I just copy pasted in some logs from wireshark and used string.format because it was a load faster. Problem is, I forgot about one field: Content-Length. It was hardcoded to what I recorded: Which was with MY username. So only usernames that were 7 characters long would work, because after that the server would stop reading, and miss some characters of the password hash. If it was too long, it would timeout as the server would be waiting for data that would never come. So that's fixed now.
Also, I found the crash bug that someone reported. It was kind of rare, so I didn't find it. Basically, the basic socket connection stuff had to throw an exception. If it was in the try block, it would skip the part that cancels the timeout. So, after it returns failed, within 3 seconds of the method call the thread that called it would end. That was usually the notice icon's thread, which held all the dialog boxes. Which means it would 'close' with no exceptions (because most of it is wrapped up with try cases), but the program itself would still run because of the ticker's thread. Fun. It's fixed too.
I can't remember if I actually did anything else with it between alien swarm and some other person I was helping and work and relatives being over. But there you go.
Any more updates?
It's looking good.
Just to give a heads up to you guys, I'm changing the format of the ticker ajax output from JSON to XML. Here's some example output:
[html]<?xml version="1.0" encoding="windows-1252"?>
<newposts>
<post username="compwhizii" postid="1" threadid="1" threadname="sw45he4sh" forumid="2" forumtitle="Main Forum" mentioned="" date="10:27AM" userid="1" newthread="1" you="1" yourthread="1" lastread="1 Hour ago" />
<post username="compwhizii" postid="2" threadid="2" threadname="sdrtjhrsjsr" forumid="2" forumtitle="Main Forum" mentioned="" date="10:28AM" userid="1" newthread="1" you="1" yourthread="1" lastread="2 Days ago" />
<post username="compwhizii" postid="3" threadid="3" threadname="Article: Welcome to the new CMS. Read me first." forumid="3" forumtitle="vBCms Comments" mentioned="1" date="1:31PM" userid="1" newthread="1" you="1" yourthread="1" lastread="0" />
<post username="EventLogTest4" postid="4" threadid="4" threadname="New thread" forumid="2" forumtitle="Main Forum" mentioned="" date="11:16AM" userid="5" newthread="1" you="" yourthread="" lastread="2 Days ago" />
<post username="EventLogTest4" postid="5" threadid="2" threadname="sdrtjhrsjsr" forumid="2" forumtitle="Main Forum" mentioned="" date="11:17AM" userid="5" newthread="" you="" yourthread="1" lastread="2 Days ago" />
<post username="EventLogTest4" postid="6" threadid="2" threadname="sdrtjhrsjsr" forumid="2" forumtitle="Main Forum" mentioned="" date="11:22AM" userid="5" newthread="" you="" yourthread="1" lastread="2 Days ago" />
<post username="compwhizii" postid="7" threadid="1" threadname="sw45he4sh" forumid="2" forumtitle="Main Forum" mentioned="" date="11:25AM" userid="1" newthread="" you="1" yourthread="1" lastread="1 Hour ago" />
<post username="compwhizii" postid="8" threadid="2" threadname="sdrtjhrsjsr" forumid="2" forumtitle="Main Forum" mentioned="" date="11:27AM" userid="1" newthread="" you="1" yourthread="1" lastread="2 Days ago" />
<post username="compwhizii" postid="9" threadid="4" threadname="New thread" forumid="2" forumtitle="Main Forum" mentioned="" date="11:27AM" userid="1" newthread="" you="1" yourthread="" lastread="2 Days ago" />
<post username="compwhizii" postid="10" threadid="4" threadname="New thread" forumid="2" forumtitle="Main Forum" mentioned="" date="3:45PM" userid="1" newthread="" you="1" yourthread="" lastread="2 Days ago" />
<post username="compwhizii" postid="11" threadid="4" threadname="New thread" forumid="2" forumtitle="Main Forum" mentioned="" date="7:21PM" userid="1" newthread="" you="1" yourthread="" lastread="2 Days ago" />
<post username="compwhizii" postid="12" threadid="1" threadname="sw45he4sh" forumid="2" forumtitle="Main Forum" mentioned="" date="7:58PM" userid="1" newthread="" you="1" yourthread="1" lastread="1 Hour ago" />
</newposts>
[/html]
It shouldn't be too hard to update you're applications with an XML parser, but if you really need it I can add a format parameter so you can get json.
[i][b]Fuck XML.[/b][/i]
[QUOTE=compwhizii;24019372]changing the format of the ticker ajax output from JSON to XML[/QUOTE]
Why the hell would anyone ever do that?
[QUOTE=compwhizii;24019372]Just to give a heads up to you guys, I'm changing the format of the ticker ajax output from JSON to XML. Here's some example output:
[html]<?xml version="1.0" encoding="windows-1252"?>
<newposts>
<post username="compwhizii" postid="1" threadid="1" threadname="sw45he4sh" forumid="2" forumtitle="Main Forum" mentioned="" date="10:27AM" userid="1" newthread="1" you="1" yourthread="1" lastread="1 Hour ago" />
<post username="compwhizii" postid="2" threadid="2" threadname="sdrtjhrsjsr" forumid="2" forumtitle="Main Forum" mentioned="" date="10:28AM" userid="1" newthread="1" you="1" yourthread="1" lastread="2 Days ago" />
<post username="compwhizii" postid="3" threadid="3" threadname="Article: Welcome to the new CMS. Read me first." forumid="3" forumtitle="vBCms Comments" mentioned="1" date="1:31PM" userid="1" newthread="1" you="1" yourthread="1" lastread="0" />
<post username="EventLogTest4" postid="4" threadid="4" threadname="New thread" forumid="2" forumtitle="Main Forum" mentioned="" date="11:16AM" userid="5" newthread="1" you="" yourthread="" lastread="2 Days ago" />
<post username="EventLogTest4" postid="5" threadid="2" threadname="sdrtjhrsjsr" forumid="2" forumtitle="Main Forum" mentioned="" date="11:17AM" userid="5" newthread="" you="" yourthread="1" lastread="2 Days ago" />
<post username="EventLogTest4" postid="6" threadid="2" threadname="sdrtjhrsjsr" forumid="2" forumtitle="Main Forum" mentioned="" date="11:22AM" userid="5" newthread="" you="" yourthread="1" lastread="2 Days ago" />
<post username="compwhizii" postid="7" threadid="1" threadname="sw45he4sh" forumid="2" forumtitle="Main Forum" mentioned="" date="11:25AM" userid="1" newthread="" you="1" yourthread="1" lastread="1 Hour ago" />
<post username="compwhizii" postid="8" threadid="2" threadname="sdrtjhrsjsr" forumid="2" forumtitle="Main Forum" mentioned="" date="11:27AM" userid="1" newthread="" you="1" yourthread="1" lastread="2 Days ago" />
<post username="compwhizii" postid="9" threadid="4" threadname="New thread" forumid="2" forumtitle="Main Forum" mentioned="" date="11:27AM" userid="1" newthread="" you="1" yourthread="" lastread="2 Days ago" />
<post username="compwhizii" postid="10" threadid="4" threadname="New thread" forumid="2" forumtitle="Main Forum" mentioned="" date="3:45PM" userid="1" newthread="" you="1" yourthread="" lastread="2 Days ago" />
<post username="compwhizii" postid="11" threadid="4" threadname="New thread" forumid="2" forumtitle="Main Forum" mentioned="" date="7:21PM" userid="1" newthread="" you="1" yourthread="" lastread="2 Days ago" />
<post username="compwhizii" postid="12" threadid="1" threadname="sw45he4sh" forumid="2" forumtitle="Main Forum" mentioned="" date="7:58PM" userid="1" newthread="" you="1" yourthread="1" lastread="1 Hour ago" />
</newposts>
[/html]
It shouldn't be too hard to update you're applications with an XML parser, but if you really need it I can add a format parameter so you can get json.[/QUOTE]
I don't see any parameters for the post content. Fair enough though, I don't use it often, and I don't like having to go through that json library anyways. I'll just update it so that it checks to see if it begins with <, and if so parses with XML. Will the sample be the final version of spec?
Also, since when did you change the ticker output? I thought that was garry.
[editline]12:02AM[/editline]
[QUOTE=Rashy;24008824]Any more updates?
It's looking good.[/QUOTE]
After no response for 2 weeks, one would assume either people were not using it, or there were no issues.
[QUOTE=ShaRose;24026061]I don't see any parameters for the post content. Fair enough though, I don't use it often, and I don't like having to go through that json library anyways. I'll just update it so that it checks to see if it begins with <, and if so parses with XML. Will the sample be the final version of spec?
[/quote]
Strictly speaking, you should be checking for the <?xml ?> tag.
[quote]Also, since when did you change the ticker output? I thought that was garry.[/QUOTE]
He's helping garry with it.
[QUOTE=ShaRose;24026061]I don't see any parameters for the post content. Fair enough though, I don't use it often, and I don't like having to go through that json library anyways. I'll just update it so that it checks to see if it begins with <, and if so parses with XML. Will the sample be the final version of spec?
Also, since when did you change the ticker output? I thought that was garry.[/QUOTE]
I removed the post content since it was HTML and the ticker never used it. That sample isn't final, but if anything I'm adding parameters so you can use it to update your code.
As for me changing the ticker, you've been missing out on what's going on. See this: [url]http://www.facepunch.com/showthread.php?t=980694[/url]
[editline]07:31AM[/editline]
Would you guys be interested in me making the unrendered raw post available?
[QUOTE=compwhizii;24033068]Would you guys be interested in me making the unrendered raw post available?[/QUOTE]
Could you provide a (readonly) Facepunch API?
The archive somewhat works as an easily scrapable thing, but a proper API would work even better.
Maybe to some extent.
[QUOTE=compwhizii;24033068]I removed the post content since it was HTML and the ticker never used it. That sample isn't final, but if anything I'm adding parameters so you can use it to update your code.[/QUOTE]
I never used it either. If you are adding features, one thing I'd suggest is that first block of posts be a bit smaller, or a limit to how many get returned.
[QUOTE=compwhizii;24033068]As for me changing the ticker, you've been missing out on what's going on. See this: [url]http://www.facepunch.com/showthread.php?t=980694[/url][/QUOTE]
Yeah, I did miss that.
[QUOTE=compwhizii;24033068]Would you guys be interested in me making the unrendered raw post available?[/QUOTE]
Example?
[QUOTE=ShaRose;24035381]I never used it either. If you are adding features, one thing I'd suggest is that first block of posts be a bit smaller, or a limit to how many get returned.[/quote]
I'll add a limit parameter.
[QUOTE=ShaRose;24035381]Example?[/QUOTE]
[html]<?xml version="1.0" encoding="windows-1252"?>
<newposts>
<post username="compwhizii" postid="15" threadid="1" threadname="sw45he4sh" threadlink="showthread.php?1-sw45he4sh&p=15&viewfull=1#post15" forumid="2" forumtitle="Main Forum" forumlink="forumdisplay.php?2-Main-Forum" mentioned="" date="11:02AM" userid="1" userlink="member.php?1-compwhizii" newthread="" you="1" yourthread="1" lastread="4 Hours ago">Post content post lol</post>
<post username="compwhizii" postid="16" threadid="1" threadname="sw45he4sh" threadlink="showthread.php?1-sw45he4sh&p=16&viewfull=1#post16" forumid="2" forumtitle="Main Forum" forumlink="forumdisplay.php?2-Main-Forum" mentioned="" date="11:02AM" userid="1" userlink="member.php?1-compwhizii" newthread="" you="1" yourthread="1" lastread="4 Hours ago">[img]http://someshit/img.png[/img] Look at this image!!!!!</post>
</newposts>
[/html]
Like that. Take note of the forum/thread/user links.
[QUOTE=compwhizii;24019372]Just to give a heads up to you guys, I'm changing the format of the ticker ajax output from JSON to XML. Here's some example output:
It shouldn't be too hard to update you're applications with an XML parser, but if you really need it I can add a format parameter so you can get json.[/QUOTE]
Who in their right might would ever have a preference of XML over JSON? Yes, adding a JSON output parameter would be a sane choice.
The reason I chose XML to be the new standard format was that vBulletin was using it for its ajax output so I wanted to have one common standard. I'll add that json parameter for you guys, didn't know this would cause so much uproar.
I actually prefer the XML as said.
XML is extremely hard to work with in almost every non-microsoft language. You'll see this very clearly in Java with SAX.
[QUOTE=andersonmat;24050841]XML is extremely hard to work with in almost every non-microsoft language. You'll see this very clearly in Java with SAX.[/QUOTE]
I code in C#.
That was my point.
I do use the post content, but it would be nice if it was raw instead of the old HTML (I went out of my way to parse it back into BB code).
And for goodness sake, have the output format a parameter. I don't care if you change XML to be the default, but provide a JSON option.
fp_ticker.php?aj=1&json=1&limit=100&pagetext=1
Aj for raw data
Json for JSON formatted output
Limit is self explanitory (max 100)
Pagetext for raw bbcode of post
Posting from my phone so its just off the top of my head.
Because I was bored. The code is AWFUL, I should be shot. I'll properly rewrite it all again.
[media]http://www.youtube.com/watch?v=QZ3AI6jwClk[/media]
Sorry, you need to Log In to post a reply to this thread.