2

I want to hide posts in the feed that have a #joined hashtag. I tried to create a GreaseMonkey script with jQuery in the past, but it couldn't detect any posts that have the #joined text.

Am I using the wrong library? A starting point, or an existing library/plug-in would be helpful.

OFF-TOPIC: At the moment, Yammer does not have any feature to hide posts with a specific hashtag, although it has a feature to follow a hashtag.

geffchang
  • 3,279
  • 2
  • 32
  • 58

3 Answers3

1

I know that this is a pretty old question but I too was trying to create a Chrome based Add-on that hides these #joined posts (or any post with a specific hashtag). I came across this blog https://you.stonybrook.edu/thebaron/2014/10/06/hiding-joined-yammer-posts-in-chrome/ where the author of the post has shared his work (https://gist.github.com/thicknrich/e4cc2871462a6850fe8c). This is a simple javascript and does the job.

//Script from https://gist.github.com/thicknrich/e4cc2871462a6850fe8c

//load jQuery based on this SO Post: 
//http://stackoverflow.com/questions/2246901/how-can-i-use-jquery-in-greasemonkey-scripts-in-google-chrome
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
  var script = document.createElement("script");
  script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
  script.addEventListener('load', function() {
    var script = document.createElement("script");
    script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
    document.body.appendChild(script);
  }, false);
  document.body.appendChild(script);
}

// the guts of this userscript
function main() {
  // Note, jQ replaces $ to avoid conflicts.

  setInterval(function() {
  //if a item thread contains #joined, hide it
  //check every 5 second. 
    jQ('.yj-thread-list-item:contains("#joined")').css("display", "none");
}, 5000);

}

// load jQuery and execute the main function
addJQuery(main);
S.Krishna
  • 868
  • 12
  • 26
0

You can find all joined messages with the following endpoint, based upon the #joined topic:

GET https://www.yammer.com/api/v1/messages/about_topic/[:id].json

But you can only delete messsages that you own: DELETE https://www.yammer.com/api/v1/messages/[:id]

Source: https://developer.yammer.com/restapi/

Note that this is a conscious decision by the product team, although joined messages can get spammy when a network becomes viral, it is a great opportunity to engage users right away once they join. It makes them feel welcome. As a community manager, I'd encourage you to welcome that user in and also encourage other yammer champions to welcome these users also. As a side effect, it also encourages people to follow the groups they are interested in and use the Top or Following feeds instead of the all (firehose) feed which has all these joined messages.

Peter Walke
  • 2,497
  • 6
  • 33
  • 50
  • 1
    Thanks, but not what I was looking for though. I belong to a VERY LARGE organization with offices worldwide. So, the number of #joined posts can quickly clutter the All Company feed everyday. That's why I was looking for a live script that could hide those posts, preferably using Greasemonkey or any browser add-on. – geffchang Jul 17 '14 at 04:53
0

Just want to note that the statement in a reply here "But you can only delete messsages that you own" is not entirely correct it is possible to delete message that do not belong to you if you are a network admin. I just ran a little experiment after reading this post and deleting #joined messages that don't belong to me worked just fine.

KnuturO
  • 1,565
  • 15
  • 19
  • From documentation: Remove a message. To remove a message, you must either (1) have posted the message yourself (2) be an administrator of the group the message was posted to or (3) be an admin of the network the message is in. – KnuturO Jun 15 '16 at 23:01