-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for StackExchange #31
Comments
Hi Paulo, If the format of the Thank you, |
Hi Mike! Sadly, I could not spend much time in the code, as I have a thesis to write (ouch). 😉 To the extent of my checking, the StackExchange Still, the login part looks a bit tricky, as it is done via StackExchange OpenID (and the site sometimes redirects connections). I was looking at ChatExchange for some hints, and it seems the OpenID part requires some tweaking indeed. But, apart from this nuisance, the port looks potentially doable (I am trying to be cautious on saying strong statements 😉 ). I offer my help to tackle the login part, although my time is quite restricted nowadays. And please, feel free to ignore this request if, at the end of the day, tweaking the code would cause a lot of headaches. 😉 All the best! Paulo |
Thank you for the information, Paulo. It sounds like it's not as simple as originally thought. :( However, this would surely be a nice feature to add. Maybe I will work on it later. Good luck with your thesis! |
Repoking this issue: I have added support for Stack Exchange in my bot (based on OakBot). Simply changing the domain is enough. There are however some pitfalls to be aware of:
Those should be fairly self-explanatory. Once you change the site, user ID's change. Room ID's too. Passing the domain allows you to get the appropriate property from bot.properties (for an instance so_admins and mse_admins. Check the domain, set admins to the right one). Passing domain to Rooms (class) you can append that to the name (for an instance stackoverflow.com-rooms, meta.stackoverflow.com-rooms) which saves the appropriate room IDs to the appropriate database entry. I'm still working on implementing this, primarily connected with meta stackexchange but it appears to be universal. any *.stackexchange.com has chat at chat.stackexchange.com. Custom domains (stackoverflow.com, superuser.com, etc) have at their own domains. Checked the fkey regex, and looked for the fkey in Shadows Den (on meta stackexchange chat) and it matched. 32 hex. As for login, changing the domain in StackOverflowWSEvents (added a second constructor, domain defaults to stackoverflow if not defined) and nothing else allows login. It is primarily admin ID's, banned ID's and bot ID that causes issues. Still working on implementing fixes in my bot |
Cool, thanks for the additional info. :) |
Hi friends! Sorry for the huge hiatus (note to self: PhD takes more time than expected). Any updates on this? I tried the code a couple of minutes ago and I failed to make it work on a StackExchange room. Perhaps @LunarWatcher could give me some hints. 😉 All the best! |
No, sorry. :( Haven't worked much on Stack Exchange compatibility. Also: ducks! |
Just as a heads-up, SE openID is deprecated, which can result in problems with login to SE later. SO login, as originally done in the bot, is fortunately not affected. But login into SE chat still uses OpenID. Meta.SE login is virtually the same as into SO, but SE is still complicated because it uses different endpoints. First you POST to |
Hi @LunarWatcher! Thank you very much for the heads up, I will try to delve into the code. 😉 Quack! 🦆 |
@LunarWatcher Do you have any code you could post for the SE login? Or know where I can find some? I spent about an hour trying to get something to work, with no luck. The hard part is that the SE login page uses JavaScript to submit the credentials. The login URL that you posted wouldn't quite work with the bot at face value because the anchor ("#log-in") causes some JavaScript to run in the browser. |
Never mind. I think I figured it out! I was trying to use Firefox's F12 developer menu, but it was clearing the list of network requests on every click, so I couldn't see the URLs the browser was sending requests to. Edge actually worked better. 😵
|
Ok, I think I got it working! Thanks for your tips @LunarWatcher! Let me know how it works if you try it out! 🎉 |
Brilliant, friends! It's working like a charm! Time to revive our beloved Psmith! All the best! |
Friends, sorry to bump this issue, but I do believe recent changes in SE broke the support. I will try to take a closer look during this week and report back... Happy Easter! 😉 |
Ugh, just great. 😕 Thanks for letting us know! 😀 |
Deeply sorry @mangstadt... 😢 |
Hi there, congrats for the cool project! 😉
Is there any plan for supporting StackExchange-based chatrooms? I did a couple of tests and it looks doable: although I could not make the bot successfully login, it intercepts messages and parses them accordingly, so it seems we are almost there. 😉
Just a quick info: maybe the
fkey
regex should be redone as the format looks quite different in SE sites (as it incorporates arbitrary length and hyphens). An alternative solution is to rely on jsoup for getting data from HTML sources.Keep up the good work! 🍰
All the best,
Paulo
The text was updated successfully, but these errors were encountered: