I think this is actually what I'm looking for - I thought about it last night, but couldn't reconcile to this object (key piece I was missing was the embedded public class chatters)
So +1 to you sir, and will update my implementation.
I think this is actually what I'm looking for - I thought about it last night, but couldn't reconcile to this object (key piece I was missing was the embedded public class chatters)
So +1 to you sir, and will update my implementation.
Not the < code > html tags?
Because, why?
Delete refers to the Draft it auto saves, so yes, there's content to delete, the saved temporary data.
Password reset from preferences, not forgot password, ben.
You should issue a password reset email for anyone reading the thread, it only requires session data, not actual login.
Reusing a channel variable defined on connect, which is #channelname
the data comes back with \r\n's in it, that was just a relic from my debugging which can be removed I think.
This is what I've ended up with so far, which should work, assuming the structure doesn't change (which is generally possible considering it's an unofficial endpoint for the twitch chat api)
using (var w = new WebClient())
{
w.Proxy = null;
var jsonData = w.DownloadString(string.Format("http://tmi.twitch.tv/group/user/{0}/chatters", channel.Substring(1, channel.Length -1)));
var stream = JObject.Parse(jsonData.Replace(@"\r\n", ""));
var chatLinks = stream.SelectToken(@"_links");
var chatCount = stream.SelectToken("chatter_count");
var getAdmins = stream.SelectToken("chatters").SelectToken("admins").Select(s => (string)s).ToList();
var getStaff = stream.SelectToken("chatters").SelectToken("staff").Select(s => (string)s).ToList();
var getModerators = stream.SelectToken("chatters").SelectToken("moderators").Select(s => (string)s).ToList();
var getViewers = stream.SelectToken("chatters").SelectToken("viewers").Select(s => (string)s).ToList();
}
Open to suggestions if anybody sees a better way to do it.
[C#]
I'm working through creating a bot to help maintain some community events on twitch tv
Criteria: I want to get a list of all users in the channel and parse them out into their proper groups so I don't have to manually maintain permissions outside of twitch.
This is probably extremely basic for anybody used to working with JSON - but I have very limited exposure to JSON, and usually only for objects I create for serialization/deserialization [thus can automagically handle it using libraries like fastJSON or newtonsoft.
A link is queried via webclient, and returns the following text:
{
"_links": {},
"chatter_count": 1969,
"chatters": {
"moderators": [
"bostv",
"botofsteel"
],
"staff": [],
"admins": [
"ravager"
],
"viewers": [
"0dawgy0",
"157yoshi157"
]
}
}
I care about:
I've got the key/value pairs as follows:
using (var w = new WebClient())
{
w.Proxy = null;
var jsonData = w.DownloadString(string.Format("http://tmi.twitch.tv/group/user/{0}/chatters", channel.Substring(1, channel.Length -1)));
var stream = JObject.Parse(jsonData);
foreach (var item in stream)
{
//Inner object data required here
Console.WriteLine(item.Key + "key, value: " + item.Value);
}
}
Any recommendations on parsing the inner elements without doing regex matching? foreach(json.data.key.innerkey/child....?)
Ultimately I'm going to take the results from the data and insert it into a database to track new users, returning users, etc. Basically I'm just trying to get to the inner most data, and tracking which category it's sourced out of.
[Edit] Looks like '.SelectToken("value"); is going to be my best bet?
Note: No popup prompted if I wanted to post in the new topic location, or old topic location. So it might have been an issue with that logic.
This will prompt the 'kill page' in chrome, a server error 500 if trying to post, freezing the profile page if used in a PM, a server 500 error if you try to post the PM, and profile page freezing every time you load it (FOREVER) if you let the app save it as unsent draft (or whatever you call the feature)
Continuing the discussion from Bug: Sending PM that crashes preview pane is preserved - crashing profile page:
Knowing these forums, somebody probably figured out a way to persist a logout bomb that checks if the user is Nagesh.
I was playing with my crash code and decided I wanted to reply on another thread, so i clicked 'cancel reply' -> 'yes, abandon' and clicked reply to user (the same user who I was originally replying to @codinghorror) and my reply went to the wrong topic.
Knowing these forums, somebody probably figured out a way to persist a logout bomb that checks if the user is Nagesh.
The irony asking for a post for repro.
I'll bite. I'll make a new one in a bit and link to it. Shouldn't take long, but the example isn't going to be optimized for crash, just to force one.
When you get it, post it into your private message and let it sit for a bit and enjoy your profile freezing any time you go to the page.
Does quoting someone with @blakeyrat place a notification in his queue, even though you didn't explicitly call him out?
Filed under: We need a new cloud attack
I just realized that when I go to like something, it's always using the heart as I can see it a lot easier. My brain ignores the hyperlink to 'like it too' because it's below the hotlinks + reply button which my brain implicitly signs as 'End of post'
That would probably be sufficient, I'm really just looking for any type of break between the two hyperlinks that aren't hyperlinks.
Technical users are actually bad examples, as most have expectations on what to expect. A typical user usually expects something completely different than a technical user.
Anybody try an XSS using a javascript image yet?
Continuing the discussion from I'm a nobody, and I'm out:
<img src='/uploads/default/2769/aca021bc02e4f63d.jpg'>
Can we get a pipe character, hyphen, anything between 'X people liked this.' and 'Like it too.'?
I keep clicking 'Like' when I'm only trying to figure out who the hell could like such an abomination. Just looking for something that gives more of a separator between the two things to be more discoverable that these are actually two separate functions.
Repro is trying to make a post when logged out. You get that a lot.
If we use @blakeyrat he might get so many notifications he rage quits again when he comes back.
Votes out if this is a good or bad thing tm
That's actually more entertaining than what discourse is doing. My cats do this more than my dog, but I always am pleased to see them twirl about.
Continuing the discussion from Might I make a humble request...:
You're going to have to try a lot harder if you want to break me.
Challenge Accepted, @mikeTheLiar
Be the first to XSS exploit a bitcoin / dogecoin mining feature while reading the thread. Nobody will notice the 100% cpu utilization anyway.
This needs more holding of knees and rocking back and forth.
No, being able to send a password reset after clearing browser history+cache is TRWTF - it uses the session data to send the password reset.
Time and a half maximum daddyo
That's actually a feature, not a bug.
On the bright side, I was eventually able to fix it by just telling it to continue waiting for ~ 25 minutes, ctrl+a, del
But yeah, it looks like it's supposed to be helpful 'unsent draft' functionality to me.
I had intended to use reply, but clicked on the wrong reply button. Then I said fuck it, and added your @tag instead.
[Edit] Why is this my URL when replying to your post above?
http://what.thedailywtf.com/t/discourse-reopens-all-tabs-to-the-wrong-topic-after-discourse-crash-server-error-500/1058/35
@darkmatter
Can you use this to onebox to a non white listed site by having the base onebox be a whitelisted one?
It's fine not to be your bug. It only happens exclusively on your software which is designed to break just about every 'normal' browser behavior, the other 8 tabs loaded correctly.
But it's cool, it's just me. I wasn't reading those tabs anyway.
I'll go out on a limb and say it's less about auto linking, and more about /... redirects to /Ellipsis, and you're not auto following.
This isn't a bug report, it's just noting behavior. Sometimes consistent with what I expected, sometimes inconsistent.
RE: finding from earlier about the internal server error 500 crashing the preview pane for discourse, I wanted to send a copy over to error for him to look at. Which crashed the preview pane for the private message. (Not really a big surprise there, but meh.)
However: Once I reloaded the browser, and went back to my profile to view other stuff, the create new message box still contains the data from the crash, re-crashing the profile each time I load my user profile.
(I don't think that it's being preserved by my browser, but feel free to correct me, and I'll delete this topic)
I was able to successfully request a password reset after clearing cache + cookies from my user profile page. Intentional?
Sure, I'd typically agree, except discourse happens to
SPAM THE SHIT OUT OF MY HISTORY
and if I want to find anything useful in there, I typically 'Sweep the shit out the door' then go about my normal business.
Also, I generally agree with Arantor - retaining the login view after clearing cache/cookies is generally a security flag.
I'll just leave this here for you, so that you can check if the cookie exists... using javascript.
We already have enough clouds?
It's cool, just...
What the fuck?
I'm not sure what to even think about this monstrosity.
there are people running 386 emulators in the browser through JS
What the actual fuck?
Just want to see what happens if I link to the ellipsis page on wikipedia.
http://en.wikipedia.org/wiki/...
Should link to Ellipsis onebox
http://en.wikipedia.org/wiki/......
Should link to Ellipsis onebox
http://en.wikipedia.org/wiki/`
Should link to %60
I don't even know what to make of this.
The above is actually the character alt+0164, which during one boxing actually encodes my character (%C2%A4)
Also character encoded automatically (%C3%A2)
Again. (%E2%99%A0)
Because the preview pane and post display are different, I suspect.
Mine was too fat to get into the post chain, I want something that when somebody goes to quote it, discourse goes down :D
(Say, 25 characters max for bonus points?)
Which is why the checkbox applies. I'm fairly sure the 'show/hide preview' link isn't actually disabling the parser - so if you've created something that hoses the preview pane, whether or not you're showing it will break posting ability.
My proposal would be if(isChecked(hidePreview)){return;} //SuperPseudoGOOOO!
To completely, 100% disable the preview tab.
Now there's something I haven't seen anyone try yet:
Anyone up to trying to create a DoS attack using regex + discourse parser?