Modding the new MR Spy

Discussion in 'Site and Forum Feedback' started by sammich, Jun 13, 2015.

  1. sammich, Jun 13, 2015
    Last edited: Sep 12, 2015

    sammich macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #1
    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.
     

    Attached Files:

  2. Gwendolini macrumors 6502

    Gwendolini

    Joined:
    Feb 5, 2015
    Location:
    random
    #2
    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?
     
  3. Gwendolini macrumors 6502

    Gwendolini

    Joined:
    Feb 5, 2015
    Location:
    random
    #3
    Ah, understand the green plus now. It is indicating a new thread.
     
  4. redheeler macrumors 603

    redheeler

    Joined:
    Oct 17, 2014
    #4
    @sammich If the script can block posts from specific forums, I wouldn't hesitate to give it a go :)
     
  5. sammich, Jun 14, 2015
    Last edited: Jun 14, 2015

    sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #5
    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
     

    Attached Files:

  6. redheeler macrumors 603

    redheeler

    Joined:
    Oct 17, 2014
    #6
    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.
     
  7. sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #7
    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 == "http://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.
     
  8. sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #8
  9. redheeler macrumors 603

    redheeler

    Joined:
    Oct 17, 2014
    #9
    Great, thanks! Maybe I will be able to actually use the new Spy now :)
     
  10. sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #10
    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.
     
  11. grahamperrin macrumors 601

    grahamperrin

    Joined:
    Jun 8, 2007
    #11
    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.
     
  12. sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #12
    I've updated the script. You have a button at below the ignore forum textarea now.

    Flattery will get you anywhere ;)

    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;
    }
    The first CSS rule above applies this.
    Add this below line 56 in the original script:
    Code:
    snip = tempEl.find('.listBlock.info .snippet');
    snip.prev().before(snip);
    
    Can't do this. Snippets are sent by the server and come truncated already.

    --

    Other things should be able to be modified via CSS.
     
  13. grahamperrin, Jul 5, 2015
    Last edited: Jul 5, 2015

    grahamperrin macrumors 601

    grahamperrin

    Joined:
    Jun 8, 2007
    #13
    @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.

     
  14. sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #14
    See attached: I'm guessing you haven't enabled that option and you're not seeing any change.
     

    Attached Files:

  15. grahamperrin macrumors 601

    grahamperrin

    Joined:
    Jun 8, 2007
    #15
    @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!
     
  16. grahamperrin macrumors 601

    grahamperrin

    Joined:
    Jun 8, 2007
    #16
    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
     
  17. redheeler macrumors 603

    redheeler

    Joined:
    Oct 17, 2014
    #17
    Lose the leading spaces on the forum names and try again.
     
  18. grahamperrin macrumors 601

    grahamperrin

    Joined:
    Jun 8, 2007
    #18
    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
     
  19. sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #19
    That gives me an idea: split screen Spy on one side and thread opens on the right (or the left :wink:)). Maybe even threads with tabs...
     
  20. sammich, Jul 8, 2015
    Last edited: Jul 8, 2015

    sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #20

    Attached Files:

    • spy.png
      spy.png
      File size:
      312.8 KB
      Views:
      106
  21. arn macrumors god

    arn

    Staff Member

    Joined:
    Apr 9, 2001
  22. stridemat Moderator

    stridemat

    Staff Member

    Joined:
    Apr 2, 2008
    Location:
    UK
    #22
  23. redheeler macrumors 603

    redheeler

    Joined:
    Oct 17, 2014
    #23
  24. sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #24
  25. sammich thread starter macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #25
    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.
     

Share This Page