I was wondering if anyone knew if it was possible to auto-open links that I receive in Slack.
I work in a call center and every time I get a call, Slackbot gives me a link that I have to click. 100% of the time, the link I receive from Slackbot must be opened.
However, I also know a little JavaScript and was thinking that maybe I could just make a program to do this for me. I was looking into Slack apps, but they don't seem to be too hackable. Anyone have any suggestions or keywords I can Google? I promise I dug through SO and Slack's docs before asking, just wanted to make sure I didn't overlook anything.
Thanks!
No, this feature currently does not exist. Slack only unfurls URLs, but does not open them.
Its currently also not possible to programmatically change how Slack processes incoming messages, e.g. to create a custom viewer etc. I hope the Slack team add that in the future though. That would be really helpful.
An approach that could work and I would recommend looking into is developing a user script for your browser. Check out Tampermonkey.
Related
I am new to Add-on development.
I am writing a Firefox extension for Hotmail using XUL tutorial. My knowledge of Javascript is pretty limited. My Firefox extension must do the following:
When the user opens a received message in MSN Hotmail to read it, locate and read the sender's email address.
Verify whether this email address is on a list. The list is stored in a simple text file in the local file system. The Add-on must read the list into memory. (I've read this is difficult with Javascript due to security concerns).
Depending on whether the address is in the list, modify the appearance of the "sender" field (I was thinking of changing the background color to green if it exists and red if it does not). The list is supposed to be a group of "secure" senders.
I don't want to use other Add-ons like Greasemonkey, since I believe it would be overkill and I want to learn how this would be done behind curtains.
Any general guides or pointers to specific documents which would help me understand how to achieve all this would be REALLY appreciated.
Which mechanism is best to perform the text-file-reading part? I've read about FileReader objects, or fopen() function, XMLHttpRequest(), and I am confused which is the best route. The file is guaranteed to be a simple text stored in the local filesystem.
I have been looking through the documentation and so far I have only a limited Add-on with a listener that can display a message when a page is loaded. If somebody can help me narrow my search I would be grateful.
Thanks and regards!
You have a couple of questions in there.
The best place to reference when developing an addon is MDN. You may also find help here on Stackoverflow's previous answers, and probably the best way to learn is to find an addon that does something similar to what you are doing, see the source code and see how they did it.
For reading/writing to a file, you can check this question on that matter.
Having that, you have to make sure you are on the desired page. You can get the current tab url with:
gBrowser.currentURI.spec
Then you see if the element that you are trying to style is on the page (meaning you are on the message window), and then you style it they way you want.
Hope this gives you some idea, but to get better and faster answers for next time, try to isolate a problem and ask a specific question about it. The scope of this question is a bit broad.
overflow community,
I've read several posts trying to solve the problem, but they dont answer my question.
Is there any legal way to find out what events (?) another site sends?
I dont ask because of illigal buissness and i am ready to find out more myself as soon as i know what i realy have to look for in terms of topic and methods.
In particular its about advertising and finding out if someone registered on another via a referal link. Like a sign that is sent as soon as the registration (on the other site which is not mine) is completed.
I want to find this out during the visit of the client on my site.
I just need to know if such a thing is legally possible and what JS topics i should give a go to find out more.
I hope my post is comprehensible enough. :)
edit: It's not about global variables.
You can use your browser's developer tools to see what's happening behind your back while you're visiting a web page (I recommend Firebug in Firefox). Alternatively, you may use a network spoofer like Wireshark to capture the traffic from the browser and analyze it in any way.
It's all up to you to find the information you think is relevant inside it in URLs, in request headers and bodies, etc. In your case, this would include script generated content and referal codes that may help keeping track of a user's browsing history across domains.
You don't really need Javascript knowledge to do this, but you need some basics about networking protocols.
This is probably as illegal as using a text editor, but just ask your lawyer if you're unsure :D
There is a website that I visit often... let's call it www.example.com. And, I am able to interact with parts of this website. The interactions send XMLHttpRequest and get a response back through Javascript, jQuery I believe.
I'm not sure what technology will let me achieve what I want to do, and where to start. Basically, I want to add additional options/shortcuts that the site does not provide. I thought about maybe using a macro, but trying to use macro recording software is just a pain in the butt.
I inspected (using Google Chrome's Developer Tools) the XMLHttpRequest being sent back and forth and I noticed that it is simple JSON messages. I figured the best way to add enhancements to the site without waiting for the actual owners of the site to do so would be to simulate the website sending/recieving these XMLHttpRequest/Response and making additional adjustments to the DOM to provide extra shortcuts.
I don't want to interfere with the original site's functionality though... ie if I send a request and receive a response I want both the original script and my script to process the response. So, here is where I'm stuck... I'm not sure whether to go along the paths of creating a C# application or a Google Chrome extension (I use Google Chrome) or something else alltogether. Any pointers on what dev tools/languages will give me the ability to do what I want would be great. Thanks!
Chrome has built in support for user scripts. You can use these to modify the page as you see fit and also to make requests. Without more details regarding what exactly you want to do with these AJAX request it's hard to advise further.
I'm not 100% sure what your question is, but as I understand it, you want to be able to make changes to a certain website. If these changes can be done with js, i would recommend Greasemonkey for Firefox. It basically lets you run a custom script when you are visiting a certain webpage/domain. You can be as specific as you want about which pages use the script. Once your script loads jQuery, it is really easy to add any functionality.
https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
You can find pre-written scripts for tons of sites here:
http://userscripts.org/
I remember following a like off of here a little while ago for something called shark.js or sharpe.js (but I might be wrong on the name). I've tried googling it, looking through here, my browser history and I have had no luck. It wasn't wkhtmltopdf, I know that much. Does anybody know what it might be called or what I am talking about? Have you got a link to it please?
Stack overflow Question: jQuery Webpage Preview
From the second answer:
http://craigsworks.com/projects/qtip/demos/content/thumbnail
That should be what your looking for, don't know if it's the exact same thing, but same functionality.
Not sure how this can be done in client side javascript in real-time. However, I bet Google uses a server-side process to capture a screenshot and then uses javascript to request an image to display to the client.
At my company most inventory tracking is done via an ASP.NET web application. The application is poorly conceived, poorly designed, poorly implemented, and somewhat of a hassle for a user to work with. These are things that are my opinion though and management has its own thoughts on the matter.
Such luxuries as the browser's back button and bookmarking pages are already not an option because of heaps and heaps of ancient Ajax code and now one of my bosses has the idea that he would prefer for the URL bar and browser buttons not to appear at all.
At first I told him that it was impossible but after thinking about it I suppose it could work if you used Javascript to create a fullscreen pop-up and run the application in that.
I personally am against this idea though since I'm the one who would do the work my own subconscious motivations are suspect so I'd like to gather some opinions on running an application in such a manner.
In addition, has anyone had any experience with transferring a regular webapp to such a setup? I'd like to know how much work could be in store for me.
Next time, for the good of the world, keep these kinds of ideas to yourself. It sounds like your boss is not qualified to make such a call, so make the call for him.
If your boss believes the url bar and browser buttons are not suppose to be there, then convert it to a stand alone app. Don't try to cram it into a web platform if its not suppose to be one.
You know the issues, so fight for what you think is right. Don't implement anything you are not going to be proud of.
You may find Prism intresting
Full Screen, no bars, just WebApp
I'd be tempted to simply add a button that allows you to pop out the app, without removing the normal mode.
If necessary, sell it with some waffle about users getting confused or not being able to reopen it or something. Or even pretend its not possible to do it without it.
That goes some way towards user friendliness. Salve your conscience anyway