Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sammich

macrumors 601
Original poster
Sep 26, 2006
4,301
266
Sarcasmville.
First off, I love the new forums that Arn and the team have put up. Vast improvement. And I'm also thankful that the Spy wasn't a porting afterthought and left for later to be released.

But I still have some suggestions that would make the Spy better.

See the attached image, and follow the instructions at this page to get started.

Last updated (see edit time):

Update!

I've moved the code hosting to a proper git repo. When you add the links below into a userscript manager, it should check for updates automatically.

Installation instructions: https://github.com/sammich/macrumors-spy-mod

Also, there's now two modes of the mod:

Split(view)
https://github.com/sammich/macrumors-spy-mod/raw/master/split.user.js

Enhanced (this is not actively maintained anymore)
https://github.com/sammich/macrumors-spy-mod/raw/master/enhanced.user.js

Only have one of these scripts running at any time.
 

Attachments

  • newspy.png
    newspy.png
    187.5 KB · Views: 420
  • split.screen.1.png
    split.screen.1.png
    74.2 KB · Views: 307
Last edited:

Gwendolini

macrumors 6502a
Feb 5, 2015
589
127
random
Wow, thanks.

Works like I charm. Those user scripts are quite handy.

As to the script for Forum Spy, it should be possible to see if it is the first post, like a new thread, or if it is a post to an existing thread. Is that possible?
 

sammich

macrumors 601
Original poster
Sep 26, 2006
4,301
266
Sarcasmville.
@sammich If the script can block posts from specific forums, I wouldn't hesitate to give it a go :)

Your wish is my code.

Update:
Added the ability to hide specific forums from appearing on the MR Spy!

At the bottom of the page, you'll find a text area. Copy and paste in the forum name from an existing post and paste it in. As soon as you paste it in, the semi-colon will append itself. Each forum should be separated with a semi-colon. This uses local storage and not store it on your MR profile, so you will need to copy the text to other browsers.

How to Update:
Unfortunately, due to the way the code is hosted, it won't update by itself (which Tampermonkey will handle on it's own, normally).

You'll need to open the link to the source file again on each browser.

https://gist.github.com/sammich/383...13d3969d51b6252dc3d722a1462f51/newspy.user.js
 

Attachments

  • ignore.png
    ignore.png
    51.2 KB · Views: 313
Last edited:

redheeler

macrumors G3
Oct 17, 2014
8,047
8,221
Colorado, USA
Your wish is my code.

Update:
Added the ability to hide specific forums from appearing on the MR Spy!

At the bottom of the page, you'll find a text area. Copy and paste in the forum name from an existing post and paste it in. As soon as you paste it in, the semi-colon will append itself. Each forum should be separated with a semi-colon. This uses local storage and not store it on your MR profile, so you will need to copy the text to other browsers.

How to Update:
Unfortunately, due to the way the code is hosted, it won't update by itself (which Tampermonkey will handle on it's own, normally).

You'll need to open the link to the source file again on each browser.

https://gist.github.com/sammich/383...b02145f3ea3d2f428848b9021426ee/newspy.user.js
Terrific! However, it doesn't seem to be working for me on a clean load of the Spy, although the blocked forum is still visible in the text field.

By the way, I don't use Tampermonkey, it's a custom Safari extension which applies CSS/Javascript files to MacRumors Forums specifically. Consequently, the thread titles at the top of threads seem to be hidden with your fix enabled.
 

sammich

macrumors 601
Original poster
Sep 26, 2006
4,301
266
Sarcasmville.
Terrific! However, it doesn't seem to be working for me on a clean load of the Spy, although the blocked forum is still visible in the text field.

By the way, I don't use Tampermonkey, it's a custom Safari extension which applies CSS/Javascript files to MacRumors Forums specifically. Consequently, the thread titles at the top of threads seem to be hidden with your fix enabled.

Is that because it's running regardless of the URL? That'd be pretty nasty. You'll have to wrap everything in

Code:
if (window.location.href == "https://forums.macrumors.com/spy/") { }

But that depends on the execution environment. That code above won't actually work in a userscripts due to sandboxing, but it will work if the scripts are being injected straight into the document.
 

redheeler

macrumors G3
Oct 17, 2014
8,047
8,221
Colorado, USA
Is that because it's running regardless of the URL? That'd be pretty nasty. You'll have to wrap everything in

Code:
if (window.location.href == "https://forums.macrumors.com/spy/") { }

But that depends on the execution environment. That code above won't actually work in a userscripts due to sandboxing, but it will work if the scripts are being injected straight into the document.

Great, thanks! Maybe I will be able to actually use the new Spy now :)
 

sammich

macrumors 601
Original poster
Sep 26, 2006
4,301
266
Sarcasmville.
For the 2 people (other than me) that use this extension, I've updated it again to improve the first post set load. The posts all appear at once and it fades in nicely with some CSS.
 
  • Like
Reactions: grahamperrin

grahamperrin

macrumors 601
Jun 8, 2007
4,942
647
See the attachment - is that what you're thinking of? …

righted-png.562712

That's more like it, and I'd love to modify your code to get something like that but I'm stumbling around in the dark.

For me personally I'd prefer the areas in the right-hand column to be de-emphasised; and upright texts instead of italic; and snippets of each post to precede the title of the topic; and the snippets to be longer.

Like you have nothing better to do with your time for one of the three (or more) users of your script :)

Seriously, thanks. I'm always in awe of people who can go out of their time to help others in this way.
 
  • Like
Reactions: I7guy

sammich

macrumors 601
Original poster
Sep 26, 2006
4,301
266
Sarcasmville.
I've updated the script. You have a button at below the ignore forum textarea now.

Like you have nothing better to do with your time for one of the three (or more) users of your script :)

Seriously, thanks. I'm always in awe of people who can go out of their time to help others in this way.

Flattery will get you anywhere ;)

right-hand column to be de-emphasised
Easiest way is for you to put CSS in. You can add in your own by appending it to the top of the script by adding in a line at line 15 (displacing the line there already).

Take the next snippet and add it in what is a blank line 15:
Code:
'#spyContents .snippet {font-style: normal;}#spyContents .location .major {font-size:smaller;}' +

The above is just this smooshed into one line:
Code:
#spyContents .snippet {
    font-style: normal;
}

#spyContents .location .major {
    font-size: smaller;
}

upright texts instead of italic
The first CSS rule above applies this.
snippets of each post to precede the title of the topic

Add this below line 56 in the original script:
Code:
snip = tempEl.find('.listBlock.info .snippet');
snip.prev().before(snip);

snippets to be longer
Can't do this. Snippets are sent by the server and come truncated already.

--

Other things should be able to be modified via CSS.
 

grahamperrin

macrumors 601
Jun 8, 2007
4,942
647
@sammich thanks, the italics disappeared but the end result is quite unlike your screenshot from 20th June.

I loved having post content and topic title in the first column.

 
Last edited:

sammich

macrumors 601
Original poster
Sep 26, 2006
4,301
266
Sarcasmville.
@sammich thanks, the italics disappeared but the end result is quite unlike your screenshot from 20th June.

I loved having post content and topic title in the first column.

See attached: I'm guessing you haven't enabled that option and you're not seeing any change.
 

Attachments

  • Screen Shot 2015-07-05 at 7.24.43 pm.png
    Screen Shot 2015-07-05 at 7.24.43 pm.png
    22.9 KB · Views: 237
  • Like
Reactions: grahamperrin

grahamperrin

macrumors 601
Jun 8, 2007
4,942
647
@sammich good guess!

I noticed neither the Ignore Forums field, nor the item beneath that field (despite your mentioning it), because the field was overlooked and then pushed out of sight whilst I focused on output from the spy!
 

grahamperrin

macrumors 601
Jun 8, 2007
4,942
647
Sorry, I can't get the ignorance to work as expected. Am I doing something wrong?

I already tried removing cookies, reloading the page and so on.

screenshot 2015-07-06 at 23.51.31.png screenshot 2015-07-07 at 00.10.48.png
 

grahamperrin

macrumors 601
Jun 8, 2007
4,942
647
Yeah, the spaces appeared automatically. Better as soon as I removed them. Thanks. Incidentally I had also experimented with line endings \r in lieu of spaces.

With filters effective, I flailed around in Tampermonkey. Some early results (smaller names in the third shot):

2015-07-07 10-41-54 screenshot.png
2015-07-07 11-13-16 screenshot.png 2015-07-07 11-21-40 screenshot.png


Eventually

2015-07-07 11-34-33 screenshot.png

Of course I'd like a tidier right hand column, but it doesn't bother me. When I do use the spy, it'll probably be something like this:

2015-07-07 11-34-23 screenshot.png
 

sammich

macrumors 601
Original poster
Sep 26, 2006
4,301
266
Sarcasmville.
  • Like
Reactions: grahamperrin

sammich

macrumors 601
Original poster
Sep 26, 2006
4,301
266
Sarcasmville.
It does not work for me. I only get a blank page.

Are you still running it from your custom extension for Safari? If you can share it with me, I can gave a look for you. Also, if you look at your console to see if any errors are there.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.