Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
9

template.user.js // ==UserScript== // @name Stack Exchange Userscript (Template) // @grant none // @match *://*.stackexchange.com/* // @match *://*.stackoverflow.com/* // @match *://*.superuser.com/* // @match *://*.serverfault.com/* // @match *://*.askubuntu.com/* // @match *://*.stackapps.com/* // @match *://*.mathoverflow.net/* // ==/UserScript== var ...


6

Your value for channelUrl is nominally correct. If I set up my XAMPP server, via httpd.conf to use port 8000, then this HTML page works perfectly fine for me: <!DOCTYPE html> <html><head> <title>StackApps SDK auth test</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head><...


6

API V2 did this, we send down: Access-Control-Allow-Credentials: false Access-Control-Allow-Methods: GET, POST Access-Control-Allow-Origin: * With every response.


5

Yes, it can be annoying that the API docs, the javascript SDK, and the settings pages use the terms: "Explicit" "Implicit" "Server side" "Client side" a little interchangeably. (The first 2 are roughly synonymous with the last two.) From the javascript SDK docs: Your application must have the client side OAuth flow enabled, and must not have the ...


5

Response capability It would be nice if this app did not only show the Stack activites but gave a chance to respond them.


4

Since the .getTime() value is already in UTC, you can just divide by 1000, and round. That is: var apiDate = Math.round (new Date().getTime() / 1000); works just fine. apiDate is in "unix epoch time" and the API takes these values even if the API parameter is called a "Date". But, if you want to truncate to the date only, just use: var dateTime = new ...


4

There's a few ways to do it, but at first glance the simplest way would be to hook into the wmdrefresh event that will get called when the preview area is updated: $(document).bind('wmdrefresh', function (event) { // Make your changes to event.target's content }); Keep in mind that the preview update fires many, many times, so be sure to cache the ...


4

This is really a great app :) I liked it very much. Can it be possible to also pass the user-id as a parameter somewhere, so that the link to original question get's linked with the referrer and would help in Announcer and Booster badge. Update - Answer to my own question above Updating the a href to required link would do the job here. Check this post ...


4

Here is a one for css too: // ==UserScript== // @name changeMe // @namespace http://use.your.homepage/ // @version 0.1 // @description addSomethingUseful // @match http*://*.stackoverflow.com/* // @match http*://*.serverfault.com/* // @match http*://*.superuser.com/* // @match http*://*.stackexchange.com/* // @match http*://*.askubuntu....


4

Stackapps works nice by using jQuery 1.4. But when I upgrade jQuery to 1.6.x it fails to show the output and giving error: "Syntax error, unrecognized expression: [href=http://app.stacktack.com/stacktack.min.css]" Check it with http://nazmulweb.com/sof (Now there is no error as I have edited the js part) And the working one is here with jQuery 1.4.x http:/...


4

What Gets Sent Madara Uchiha posted a comment asking about what information was being tracked. This answer should help clarify what's going on. The Client When the script sends a message to the server, it is one of four types: active - sent whenever the tab loses or gains focus. Other users will see your image fade when focus is lost. typing - sent ...


3

Of course as soon as I finally break down and ask a question I see my mistake: Applications that have the client side flow enabled can use https://stackexchange.com/oauth/login_success as their redirect_uri by default. I had "Desktop OAuth Redirect Uri" disabled which the javascript SDK uses. (Note the url posted in the question) Leaving this up here in ...


3

I faced the same issue when I was using the stack exchange API to post a message to stack overflow website. I figured I had to post my application on a domain name. I hosted my application on free domain provided by 000webhost.com. You may wish to take a similar approach. After deploying the application on the domain, change the oauth domain and the ...


3

Instead of polling for it, you can use a MutationObserver which exists for this exact thing: var observer = new MutationObserver(function(mutations, observer) { for (var i = 0; i < mutations.length; i++) { if ($(mutations[i].target).is('.share-tip')) { //do your thing } } }); observer.observe(document.body, { ...


3

This was even easier than I thought. Here is what you'll see after installing it: You can download the script by clicking here: http://files.quickmediasolutions.com/userscripts/owner.user.js Please let me know if it works!


3

I'm detecting which page we are using the StackExchange object: The property StackExchange.options.routeName can be (among other values): Questions/Show (/questions/POST-ID) Questions/List (/questions) Questions/ListByTag (/questions/tagged/TAG-NAME) So, to run a script only when viewing an individual post: var userscript = function($) { if( ( ...


2

Alrighty - I found the issue. Tampermonkey assumes that any exception thrown from a user script is an Error object (well...it assumes the exception data will have at least the message and stack properties). When it tries to do string operations on undefined properties, it throws its own exception which makes the whole thing blow up. The Javascript SDK ...


2

Release notes Date Version Changes 3-10-2012 0.1.0 alpha 1 Initial version 4-10-2012 0.1.0 alpha 2 Changed regular expression @include to match all StackExchange sites 4-10-2012 0.1.0 alpha 3 Added mathoverflow.net to @include RegEx 11-10-2012 0.1.0 alpha 4 ...


2

This "answer" relates to version 5a which has been superseded since. This is a minimal failing example: // ==UserScript== // @name Test // @namespace . // @description Test userscript. // @require http://code.jquery.com/jquery-1.7.1.min.js // @require http://josh.gitlin.name/userscripts/ThirdPlace.js // @include http:/...


2

How come the code isn't formatted to be in different colors? (etc, how they show on SO)


2

I think you should include $(document).stacktack(); to the javascript file, so we just need to include your library, and... that's it :D


2

You can do this by making a JSONP request. This works by returning the results of a query in a <script> tag that invokes a callback. You can find more information about it here.


2

I came across this when I was looking for a web-based notifier, and it does the job quite well. The one gripe I had with it is that it doesn't use desktop notifications, and I would have to constantly tab back over if I wanted to see what it came up with. Anyway, I hacked away at it for a few hours and did a basic implementation of desktop notifications, ...


2

There is an example of how to invoke the constructor here: // app/src/resolvers.js const stackexchange = require('stackexchange-node'); const config = require('../config/config'); const options = {version: 2.2}; const context = new stackexchange(options); const API_KEY = config['API_KEY']; const resolvers = { Query: { questions: async (root, {...


2

The markdown code supposedly lives at the pagedown project on code.google.com. (Reference) You may also find these files to be useful: The commented, human readable version of wmd.js The commented, human readable version of full.js Personally, I find it easier to just use normal <textarea> processing followed by a call to StackExchange....


1

feature-request status-completed Create a list of users that is currently in the room. Feature request completed.


1

I'll report my findings based on Brock's answer and my tests. 1) I was using Scriptish. Well, don't. Once I moved to Greasemonkey many things that were working on Chrome's Tampermonkey (where I started to develop) started to work on Firefox. 2) Chrome recognizes StackExchange at root level with @grant none. Firefox does not. 3) To make it cross browser ...


1

The question is still not clear, please rewrite it like: I do X. I expect Y. But I get Z. Update: From the comments: Apparently the OP's problem really was that accessing StackExchange.options.routeName in the script, outside the injected code, caused a ReferenceError, when using Scriptish, not Tampermonkey and Greasemonkey as stated in the question. ...


1

Is there a way for this work for other, non-stackoverflow (think: Ask Ubuntu) community ads?


Only top voted, non community-wiki answers of a minimum length are eligible