Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar

Adrian Statescu thinkphp

View GitHub Profile
var SlideShare = new Class({
Extends: Request.JSONP,
options: {
url: 'http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fthinkphp.ro%2Fapps%2Fslideshare%2FRequest.Slideshare%2Fslideshare.table.xml%22%20as%20slideshare%3B%20select%20*%20from%20slideshare%20where%20username%3D%22{username}%22',
data: {
format: 'json'
}
},
initialize: function(username,options,badgeID) {
this.options.url = this.options.url.substitute({username: username});
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Adrian Statescu</author>
<description>Select items from slideshare</description>
<documentationURL>http://www.slideshare.net/rss/user/{user}</documentationURL>
<sampleQuery>select * from {table} where username="thinkphp"</sampleQuery>
</meta>
<bindings>
var SlideShare = new Class({
Extends: Request.JSONP,
options: {
url: 'http://query.yahooapis.com/v1/public/yql?q=use%20%22http%3A%2F%2Fthinkphp.ro%2Fapps%2Fslideshare%2FRequest.Slideshare%2Fslideshare.table.xml%22%20as%20slideshare%3B%20select%20*%20from%20slideshare%20where%20username%3D%22{username}%22',
data: {
format: 'json'
}
},
initialize: function(username,options,badgeID) {
this.options.url = this.options.url.substitute({username: username});
select * from flickr.photos.info where photo_id in (select id from flickr.photos.search where woe_id in (select woeid from geo.places where text="bucharest"))
var ShowTweets = new Class({
Extends: Request.JSONP,
options: {
url: '',
data: {
format: 'xml'
}
},
initialize: function(username,options){
this.parent(options);
//show me love to the singleton
//author: Adrian
//@thinkphp
/*
Description:
create a request JSON to Twitter Service API using script tag injection and handles callback for you.
*/
var twitterbadge = function() {
/* config */
/*
Description:
-create a class ShowTweets that extends Request.JSONP using script tag injection and handles callbacks
#method send(options) - make the request
*/
var ShowTweets = new Class({
Extends: Request.JSONP,
options: {
url: '',
data: {
select text,from_user from twitter.search where q in (select content from html where url="http://swdc-central.com/" and xpath="//a[contains(.,'@')]")
/* Utilities */
if(!String.prototype.parseQueryString) {
String.prototype.parseQueryString = function() {
var mix = {};
var vars = this.split(/[&;]/);
#include <iostream.h>
class dublet
{
public: int i;int j;
dublet(int n=1;int m=1){
i=n;
j=m;
}
int operator *(dublet a){ return a.i;}