This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* return a position of needles | |
* credits goes to "msng" (https://gist.github.com/msng/5039773) | |
* | |
* @param String $haystack | |
* @param array of $needles | |
* @param number $offset | |
* @return Ambigous <boolean, number>|boolean|number | |
*/ | |
private static function strpos_array ($haystack, $needles, $offset = 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var donations = 0, | |
lastCheck = 0, | |
lastFollower = "", | |
project_id = 24307; | |
function checkForNew(){ | |
$.getJSON("https://api.betterplace.org/de/api_v4/fundraising_events/"+project_id+"/opinions.json?order=created_at:DESC&facets=has_donation:true&per_page=1", function(data){ | |
donations = data.total_entries; | |
if(donations > lastCheck && lastCheck!=0){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Example from https://github.com/scribejava/scribejava/blob/master/scribejava-apis/src/test/java/com/github/scribejava/apis/examples/TumblrExample.java | |
*/ | |
import java.util.Scanner; | |
import com.github.scribejava.core.builder.ServiceBuilder; | |
import com.github.scribejava.core.model.OAuth1AccessToken; | |
import com.github.scribejava.core.model.OAuth1RequestToken; | |
import com.github.scribejava.core.model.OAuthRequest; | |
import com.github.scribejava.core.model.Response; | |
import com.github.scribejava.core.model.Verb; | |
import com.github.scribejava.core.oauth.OAuth10aService; |