Skip to content

Instantly share code, notes, and snippets.

/**
* Listeners
*
*/
chrome.tabs.onActivated.addListener(function(activeInfo) {
refreshHiddenDomainsList();
chrome.tabs.get(activeInfo.tabId, function(tabObj) {
load_content_script(tabObj);
});
POST to "https://www.yammer.com/api/v1/activity.json?access_token=<my valid access token>"
{
"activity":{
"actor":{
"email":"[email protected]",
"name":"Chris Pal"
},
"action":"pawdev:attend",
"object":{
// doesn't work
yam.connect.embedFeed({
feedType: "open-graph",
container: '#embedfeed',
network: 'contosofoods.onmicrosoft.com',
objectProperties: {
url: "https://box.com/file/abc123",
type: "file",
title: "Yammer ROI.pdf",
image: "https://dox.com/file/abc123.png"
yam.connect.embedFeed({
container: "#embedded-feed",
network: "microsoft.com",
feedType: "open-graph",
objectProperties: {
title: "Win 8 App Home",
image: "http://betanews.com/wp-content/uploads/2012/02/Windows-8-logo-300x300.jpg"
}
});
<!doctype html>
<html>
<head>
<script data-app-id="hyB2pTvrL36Y50py8EWj6A" src="https://assets.staging.yammer.com/platform/yam.js"></script>
<style type="text/css">
#embedded-follow {
width: 800px;
height:650px;
}
@drewtang
drewtang / gist:4018374
Created November 5, 2012 17:10
double callback
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src='https://assets.yammer.com/platform/yam.js' data-app-id="EojZmPyBpg0kPaTCDAanw"></script>
<script>
/* Note: Using yam.config instead of data-app-id also causes duplicate callbacks
yam.config({
appId: 'EojZmPyBpg0kPaTCDAanw'
{
"actor": { "name": "Otto 1", "email": "[email protected]" },
"action": "follow",
"message": "A message I am following",
"users": [{ "name": "Otto 2", "email": "[email protected]" }],
"private": true,
"object": {
"url": "http://www.example.com",
"type": "person",
"title": "Object Title Otto Test",
@drewtang
drewtang / activitypost.php
Created January 25, 2012 21:45
PHP cURL Activity Post
<html>
<head></head>
<body>
<?php
$ch = curl_init();
$body ="{\"type\":\"text\",\"text\":\"hello\"}"; // type: text, text: hello
$headers = array('Content-Type: application/json');
@drewtang
drewtang / gist:1477180
Created December 14, 2011 16:05
Yammer Connect Example
yam.connect.loginButton('#yammer-login', function (resp) {
if (resp.authResponse) {
yam.request({
url: '/api/v1/users/current',
type: 'GET',
success: function (msg) {
document.write('<IMG SRC="' + msg.mugshot_url + '">' + '<h3>Welcome Back ' + msg.full_name + '!</h3>');
},
error: function (msg) { alert('Data Not Saved: ' + msg); }
});