Sign InRegisterForgotten password?

RebelmouseTwitterFacebook

Tech Note: LGF Pages Bookmarklet Supports Scribd and SoundCloud

Making blogging easier
LGF • Views: 4,255

I’m about to sling some code at you here, so watch out. There’s a new improved version of the LGF Pages bookmarklet, and if you have an LGF account you can install it by deleting the old one (if you already installed it) from your browser’s bookmarks bar, then dragging the “Create a Page” button to the bookmarks bar in its place.

The new version extends our exclusive auto-embed feature to add Scribd.com and SoundCloud to the auto-detected embed types. If you open the bookmarklet on any page containing an embedded Scribd document or SoundCloud audio file, it will be automatically added to your Page. If you want to test it out, here’s a page at Right Wing Watch with an embedded SoundCloud file: Radio Host Frequented by Gun Activists Calls for Shooting of Bush Family & Obama, Sexual Violence Against Hillary Clinton | Right Wing Watch.

Here’s the source code for the bookmarklet, in the interest of full disclosure. (Also because I want to test the latest version of our source code formatter.)

There are a couple of interesting tricks in this one; notice the method of loading jQuery by injecting a script tag into the page. I’ll leave the rest as an exercise for the nerds amongst us.

The bookmarklet source code:

(function() {
	var j = '1.9.1', d = document;
	if (window.jQuery === undefined || window.jQuery.fn.jquery < j) {
		var done = false, s = d.createElement('script');
		s.src = '//ajax.googleapis.com/ajax/libs/jquery/' + j + '/jquery.min.js';
		s.onload = s.onreadystatechange = function(){
			if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
				done = true;
				jQuery.noConflict();
				init();
			}
		};
		d.getElementsByTagName('head')[0].appendChild(s);
	} else {
		init();
	}
	function esc(s) {
		return escape(s).replace(/\+/ig, '%252B');
	}
	function init() {
		(window.LGF_post = function() {
			var f = q = w = '',
				u = esc(location.href),
				d = document,
				t = esc(d.title),
				s = esc((d.selection) ? d.selection.createRange().text : d.getSelection()),
				ob = jQuery('iframe').filter(function() {
					return this.src.match(/https?:\/\/(www\.youtube|player\.vimeo\.|w\.soundcloud\.com\/player|www\.scribd\.com\/embeds\/)/i);
				});
			if (ob.length && !u.match(/www\.youtube\.com\/|vimeo\.com\/|soundcloud\.com|www\.scribd\.com/i)) {
				f = esc(ob.eq(0).attr('src'));
			}
			q = (
				'u=' + u +
				'&t=' + t +
				'&f=' + f +
				'&s=' + s
			);
			w = (
				'width=670,' +
				'height=820,' +
				'scrollbars=1,' +
				'status=1,' +
				'menubar=1,' +
				'location=1,' +
				'resizable=1'
			);
			window.open('http://littlegreenfootballs.com/weblog/lgf-postpage.php?' + q, '_blank', w);
		})();
	}
})();

And here’s the minified version created with Google Closure Compiler:

(function(){function b(b){return escape(b).replace(/\+/ig,"%252B")}function d(){(window.LGF_post=function(){var a=q=w="",d=b(location.href),c=document,f=b(c.title),c=b(c.selection?c.selection.createRange().text:c.getSelection()),e=jQuery("iframe").filter(function(){return this.src.match(/https?:\/\/(www\.youtube|player\.vimeo\.|w\.soundcloud\.com\/player|www\.scribd\.com\/embeds\/)/i)});e.length&&!d.match(/www\.youtube\.com\/|vimeo\.com\/|soundcloud\.com|www\.scribd\.com/i)&&(a=b(e.eq(0).attr("src"))); q="u="+d+"&t="+f+"&f="+a+"&s="+c;w="width=670,height=820,scrollbars=1,status=1,menubar=1,location=1,resizable=1";window.open("http://littlegreenfootballs.com/weblog/lgf-postpage.php?"+q,"_blank",w)})()}var f=document;if(void 0===window.jQuery||"1.9.1">window.jQuery.fn.jquery){var e=!1,a=f.createElement("script");a.src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";a.onload=a.onreadystatechange=function(){if(!e&&(!this.readyState||"loaded"==this.readyState||"complete"==this.readyState))e= !0,jQuery.noConflict(),d()};f.getElementsByTagName("head")[0].appendChild(a)}else d()})();
Advertisement

Colbert Report: Why Does Eric Holder Hate Louie Gohmert’s Asparagus?

Asparagusgate
Humor • Views: 7,696

(Click below if you can’t see the MP4 video above.)

Daily Caller Cooks Up Another Stupid Scandal, Commenters Spew Vile Racism

“Umbrellagate?” Are they serious?
Wingnuts • Views: 9,640

The mind-numbingly stupid right wing fake outrage of the day: yes, now they’re even going after the President for asking Marines to hold umbrellas for himself and the Turkish Prime Minister. I just can’t even.

The hacks at wingnut propaganda site The Daily Caller lead the charge, but it’s on every single right wing blog and media website, of course, because they do this stuff in lockstep unison like good little authoritarians: Obama Breaches Marine Umbrella Protocol | the Daily Caller.

Did Obama “breach protocol?” Let’s see what the Marine Corps has to say about it:

Seeing a Marine with this particular accessory is “extremely rare,” Marine Corps spokesman Capt. Greg Wolf explained, but because the president’s the commander in chief of the Armed Forces, if he says “hold my umbrella,” it’s permissible.

The sad thing is that this laughable story actually ended up on the front pages of the New York Post, The Wall Street Journal, The Washington Post, The Washington Times and the Los Angeles Times.

This is why the wingnut lockstep army does this kind of freakishly moronic outrage-mongering — because the mainstream media enables it.

Meanwhile, again as usual, the commenters for the Daily Caller’s rage-inducing article are, yes, spewing all kinds of vile racism. They got the subtext right away — it’s a white man holding an umbrella for a black President.

I thought afro-sheen was waterproof?

[…]

Just another occasion where Obama shows his “superiority” to any and everyone around him. Shameful.

[…]

Just another example of the illegitimate Kenyan illegal alien’s arrogance, ignorance, and contempt for the military - and the Marine Corps in particular.

[…]

Next they’ll be carrying shopping bags for Michelle as she strolls ‘Miracle Mile’ looking for a bargain.

[…]

I would roll that umbrella up and shove it where the sun don’t shine. Kenyan Fraud. III%

[…]

The MONKEY BOY BATH HOUSE QUEEN WOULD MELT if SHE GOT WET!!!!!

[…]

Too funny! The first black man given the opportunity to run the most powerful country on earth and he turns out to be no different than all the other two bit corrupt black dictators around the world. For all the world to see no less. Way to go BO!

[…]

Someone…please throw some shoes at this Kenyan clown!!

On and on it goes — currently there are more than 1700 comments, almost all spewing hatred and deranged conspiracy theories. The right wing base in all its glory.

Also see:
Guest Post From a U.S. Marine About Barack Obama’s Shocking and Disgusting Use of an Umbrella

CBS Evening News: Republican Sources Caught Doctoring Emails

MSM now figuring this out but of course, Dr. Johnson was already on this trail a few days ago.
Politics • Views: 17,045

SCOTT PELLEY: Also at his news conference today the president called for tighter security for U.S. diplomatic facilities to prevent an attack like the one in Benghazi, Libya, last year that killed U.S. Ambassador Chris Stevens and three other Americans. Of course, Benghazi has become a political controversy. Republicans claim that the Administration watered down the facts in talking points that were given to U.N. Ambassador Susan Rice for television appearances while Mr. Obama was running for reelection. Republicans on Capitol Hill claim that they had found proof of this in White House e-mails that they leaked to reporters last week. Well, it turns out some of the quotes in those e-mails were wrong. Major Garrett is at the White House for us tonight. Major?

MAJOR GARRETT: Scott, Republicans have claimed that the State Department under Hillary Clinton was trying to protect itself from criticism. The White House released the real e-mails late yesterday and here’s what we found when we compared them to the quotes that had been provided by Republicans. One e-mail was written by Deputy National Security Advisor Ben Rhodes. On Friday, Republicans leaked what they said was a quote from Rhodes. “We must make sure that the talking points reflect all agency equities, including those of the State Department, and we don’t want to undermine the FBI investigation.” But it turns out, in the actual e-mail Rhodes did not mention the State Department. It read “We need to resolve this in a way that respects all the relevant equities, particularly the investigation.” Republicans also provided what they said was a quote from an e-mail written by State Department Spokesman Victoria Nuland. The Republican version notes Nuland discussing: “The penultimate point is a paragraph talking about all the previous warnings provided by the Agency (CIA) about al-Qaeda’s presence and activities of al-Qaeda.” The actual e-mail from Nuland says: the “…penultimate point could be abused by Members to beat the State Department for not paying attention to Agency warnings…” The C.I.A. agreed with the concerns raised by the State Department and revised the talking points to make them less specific than the C.I.A.’s original version, eliminating references to al-Qaeda and affiliates and earlier security warnings. There is no evidence, Scott, the White House orchestrated these changes.

More: Wow, This Is Pretty Epic

Also see:
WH Benghazi Emails Have Different Quotes Than Earlier Reported

Glenn Beck’s Crazy Crypto-Racist Rant of the Day: Whites Lynched by KKK Would Be Tea Partiers Today

Why you so crazy?
Wingnuts • Views: 15,337

On his radio program today, Glenn Beck uncorked a bizarre rant about the NAACP and Martin Luther King and Booker T. Washington and by the way, 20 PERCENT OF KKK LYNCHINGS WERE OF WHITE PEOPLE! AND THEY’D BE TEA PARTIERS TODAY!

Beck’s strategy for defending himself against charges of racism seems to be to confuse the issues so thoroughly that nobody can figure out what the hell he’s trying to say. But yeah, he’s still a racist pig.

“They are a joke,” Beck said of the NAACP, calling them “an affront” to everything that Martin Luther King, Frederick Douglass, and Booker T. Washington stood for. “You are an affront to their memory. You really are.”

Somehow, that discussion then prompted Beck to declare that “20% of the lynchings [carried out] by the KKK were of white people … and you know what, I contend [that] the white people that were lynched are exactly the kind of people that would be in the Tea Party today.”

Via: Right Wing Watch.

GOHMERT!

Fear the bristling Gohmert
Wingnuts • Views: 15,084
Bristling Gohmert

The dumbest man in Congress, Texas Representative Louie “Terror Babies from the Future” Gohmert, got all lathered up yesterday because Eric Holder said, in so many words, that Gohmert didn’t know WTF he was talking about when he asked a weird, pointless question about some tortuous Muslim-Christian persecution fantasy he apparently got from World Net Daily. So the hearing wasn’t a complete waste.

“Because of political correctness, there was not a thorough enough investigation of Tamerlan to determine this kid had been radicalized,” Gohmert said of one of the Boston bombing suspects. “On the one hand, we go after Christian groups like Billy Graham’s group - we go after Franklin Graham’s group - but then we’re hands-off when it comes to possibly offending someone who has been radicalized as a terrorist.”

Holder responded by saying that Gohmert didn’t have access to all of the facts.

“Unless somebody has done something inappropriate, you don’t have access to the FBI files,” he said. “I know what the FBI did. You cannot know what I know.”

Gohmert bristled at the suggestion that he was making false statements, repeatedly telling Holder that he “challenged my character.”

Related:
Louie ‘Terror Babies’ Gohmert: Aurora Shootings Caused by Not Enough God

Pickering and Mullen Don’t Trust Darrell Issa - and They Shouldn’t

Issa doesn’t want the public to hear what they have to say
Politics • Views: 18,158

Former Ambassador Thomas Pickering and former chairman of the Joint Chiefs of Staff Adm. Mike Mullen, who oversaw the Accountability Review Board that reviewed the government’s response to the Benghazi attack, are clearly unhappy with Republican hitman Darrell Issa and his distorted characterizations of their work: Pickering, Mullen Challenge Issa to Let Them Testify in Public.

The dispute between Issa and the co-chairmen came to a head after neither Pickering nor Mullen attended a May 8 House Oversight Committee hearing on the attacks, sparking a heated back and forth about who was invited and when. The rhetoric intensified Sunday during a highly contentious joint appearance with Issa and Pickering on NBC’s “Meet the Press” in which Issa maintained the two “refused to come before our committee.” Pickering insisted that he was not invited despite expressing a willingness to testify.

“Chairman Issa sent word back that he might want to take me up some time in the future” Pickering said.

Issa also suggested on the program that Pickering and Mullen meet with the committee behind closed doors so as not to create “some sort of stage show.” But the two assert in their letter that a public hearing is a “more appropriate forum” and accuse Issa of changing his “position on the terms of our appearance.”

By demanding that the hearing be open to the public, it’s clear that Pickering and Mullen simply don’t trust the blatantly partisan Issa to tell the truth — and they shouldn’t.

Tech Note: The LGF Pages Popup Window and Google Chrome

How to make it work
LGF • Views: 16,679

In last night’s thread about the new features in our LGF Pages posting bookmarklet, several people mentioned that the Chrome browser was blocking the window from opening.

Here’s how to fix that problem:

  • Go to Chrome Preferences.
  • At the bottom of the Settings page, click “Show advanced settings…”
  • Under Privacy, click “Content settings…”
  • In the dialog box that appears, scroll down until you see the section titled “Pop-ups.”
  • Click the button labeled “Manage exceptions…”
  • Enter “littlegreenfootballs.com” in the input field and make sure the Behavior is set to “Allow.”
  • Click “Done.”

And you’re done! Chrome will now allow the LGF Pages bookmarklet to open a new window (or tab), and all is right with the world.

Tech Note: Automatic YouTube/Vimeo Embedding for LGF Pages

Video made easy
LGF • Views: 22,928

We have a great new feature to announce tonight: when you click the LGF Pages bookmarklet on any web page that contains a YouTube or Vimeo video, the bookmarklet now automagically grabs that video’s information and embeds it in your post.

The LGF Pages bookmarklet could always do this if you opened it on the YouTube or Vimeo website, but now it can sense the presence of these video providers on any web page, and react with aplomb, dignity, and quiet reserve. Ahem.

To use this new feature you will have to reinstall your “Create a Page” bookmarklet. First delete the old one, either by dragging it off the bookmark bar or by right-clicking and choosing “Delete.” Then drag that button at the top of the right sidebar labeled “Create a Page” to your bookmark bar in its place, and you’re good to go.

Here’s a page you can test it on, at Right Wing Watch: Robertson Tells Woman Whose Husband Cheated to Remember ‘He’s a Man’ and Be Grateful She Lives in America | Right Wing Watch.

And here’s a screenshot, showing what it looks like when you open the LGF Pages bookmarklet on that page (notice that the video code is automatically generated, along with a link to the original page it came from):

UPDATE at 5/15/13 10:03:22 pm

The first release had a small bug, but it’s now fixed. Reinstall the bookmarklet one more time and everything will be groovy.

^ back to top ^

Turn off ads by subscribing!
For about 33 cents a day, our subscription option turns off all advertisements at LGF!
Read more...

► LGF Headlines

  • Loading...

► Tweeted Articles

  • Loading...

► Tweeted Pages

  • Loading...

► Top 10 Comments

  • Loading...

► Bottom Comments

  • Loading...

► Recent Comments

  • Loading...

► Tools/Info

► Tag Cloud

► Contact

You must have Javascript enabled to use the contact form.
Your email:

Subject:

Message:


Messages may be published in our weblog, unless you request otherwise.
Tech Note:
Using the Contact Form
LGF Pages Create a Page
This is the LGF Pages posting bookmarklet. To use it, drag this button to your browser's bookmark bar, and title it 'LGF Pages' (or whatever you like). Then browse to a site you want to post, select some text on the page to use for a quote, click the bookmarklet, and the Pages posting window will appear with the title and text already filled in.
Recent Pages
Skip Intro
Trump Completes Testimony in Chicago Trial, Tells Reporters Plaintiff Tried to ‘Rip’ Him Off
A scowling Donald Trump raised his voice on the witness stand Wednesday while an attorney grilled him and then rolled his eyes at the "Apprentice" star's answers, prompting a federal judge to scold both men in open court and order them to behave. The admonition came during Trump's second and final day on the stand at a civil trial where he is accused ...

1 hour, 5 minutes ago
Views: 36 • Comments: 0
Tweets: 0 • Rating: 0
theye1
The Greatest (Movie) Speech Ever Made
73 years later is still relevant and powerful as ever. It's also because of this movie that Charlie Chaplin was labelled a "premature anti-fascist."

12 hours, 56 minutes ago
Views: 155 • Comments: 5
Tweets: 0 • Rating: 5
FemNaziBitch
Iranian Photographer Wins Awards at World Photo Press
Click the link to see the pictures. Iranian photographer Ebrahim Noruzi has won two awards at the World Photo Press 2013. The winners of the world's largest and most prestigious annual press photography contest were announced on Friday. Noruzi won the first prize of the Observed Portraits Section for his photo collection "Victims of Forced Love". More: Iranian Photographer Wins Awards at World Photo ...

13 hours, 51 minutes ago
Views: 83 • Comments: 1
Tweets: 0 • Rating: 2
Romantic Heretic
The Singing Ringing Tree
Some people built this strange looking statue in England. And this is what it sounds like. Youtube Video

13 hours, 56 minutes ago
Views: 68 • Comments: 1
Tweets: 0 • Rating: 2
Vicious Babushka
Tonight’s Shabbos Menu (& Recipes)
Tonight's menu: Baked Gefilte FishBroiled Rainbow TroutRedskin Potato SaladChicken Noodle Soup Wine: Herzog ZinfandelDessert: Frozen Strawberry Daquiri Tomorrow's menu: Gefilte Fish, TroutRomaine/Avocado SaladOlive Pasta SaladRedskin Potato Salad Wine: Herzog Orange MuscatDessert: Frozen Margaritas Middle East Fried Chicken Recipe 1 broiler chicken, cut into 8ths1/4 c. unbleached flour1/2 c. Panko breadcrumbs1 Tbsp. Za'atar seasoning1 Tbsp. olive oil Preheat oven to 425. Put 1 Tbsp oil ...

17 hours, 13 minutes ago
Views: 124 • Comments: 1
Tweets: 1 • Rating: 4
Haywood Jabloeme
Allen West Named Fox News Contributor
"Representative West's congressional and military experience along with his fearless approach to voicing key issues will provide a valuable point of view to the Fox News lineup," Fox News Vice President Bill Shine said in a statement. More: Allen West Named Fox News Contributor Its categorized as "Entertainment" since even the Fox News Channel itself makes a distinction between "Hard News" and "Entertainment". ...

18 hours, 55 minutes ago
Views: 116 • Comments: 1
Tweets: 0 • Rating: 0
Michael McBacon
4 Things We Should Remember When Arguing About Politics
Political discourse in America has reached levels of douchebaggery previously only theorized about but never observed, like conversational dark matter. We're in a whole new world of hating people based solely on their opinions on a few key issues, and since this is unexplored territory, our conversations about politics are usually only a couple notches beyond the "hold your breath until the other ...

22 hours, 42 minutes ago
Views: 220 • Comments: 0
Tweets: 0 • Rating: 2
Political Atheist
LAPD Reformed as Federal Oversight Lifted, City Leaders Say
Los Angeles leaders say the Los Angeles Police Department has undergone a dramatic transformation since federal oversight of the agency was ordered 12 years ago. The dismissal Wednesday of the so-called consent decree, which arose largely out of the Rampart corruption scandal and addressed basic problems of accountability that stretched back decades, delivered a largely symbolic, but nonetheless important milestone for the LAPD ...

23 hours ago
Views: 119 • Comments: 3
Tweets: 0 • Rating: 4
Feline Fearless Leader
What to do in Orange County - LA - San Diego
Seems a good way to solicit ideas for touristing destinations and activities. Will have 4-5 days so some opportunity for visiting multiple sites. And since I do have an interest in history and military history items in that area will be welcome suggestions. (The USS Midway down in San Diego is already on the list.) If there is anything California-geology related that would be ...

1 day ago
Views: 106 • Comments: 4
Tweets: 0 • Rating: 4
Randall Gross
Sam Harris: The Fireplace Delusion
I hate to have to point this out, but: I DID NOT WRITE THIS ESSAY. I'm just READING IT ALOUD. This essay came to my attention recently, and it's an excellent exercise for a skeptic or atheist to experience this feeling of loss of innocence and the painful feelings it summons. See it through to the end before posting, please. The source:samharris.org Next ...

1 day, 22 hours ago
Views: 274 • Comments: 1
Tweets: 0 • Rating: 2
 Frank says:

The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the tree of knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your mouth shut and hadn't asked any questions. -- Playboy Interview, April 1993