Skip to content

Instantly share code, notes, and snippets.

View cosenary's full-sized avatar

Christian Metz cosenary

View GitHub Profile
@cosenary
cosenary / success.php
Last active July 30, 2018 07:43
Instagram PHP API - How to get the most recent media published by an Instagram user.
<?php
/**
* Instagram PHP API
* Example for using the getUserMedia() method
*
* @link https://github.com/cosenary/Instagram-PHP-API
* @author Christian Metz
* @since 31.01.2012
*/
@cosenary
cosenary / README.markdown
Last active June 21, 2020 16:56
Instagram PHP API - How to implement a load more button (AJAX)

Instagram PHP API

How to use

index.php file

Enter your Instagram client id and display the first results.
Then store the next_max_id which you receive if you call:

$media->pagination->next_max_id;

@cosenary
cosenary / README.markdown
Last active December 29, 2017 06:59
Instagram PHP API - Working example: Load more button (AJAX)

Instagram PHP API

How to use

This a working example based on the previous posted workflow.
Feedback is as always welcome.

Original project repository: Instagram-PHP-API

index.php file

@cosenary
cosenary / ajax-script.js
Created June 22, 2012 23:36
Suggestion to improve `load-more button` for TDunham02
// Relace the jQuery AJAX snippet by this:
$.ajax({
type: 'GET',
url: 'ajax.php',
data: {
tag: tag,
max_id: maxid
},
dataType: 'json',
@cosenary
cosenary / index.php
Last active June 14, 2019 19:49
Instagram PHP API - Likes
<?php
require 'Instagram.php';
use MetzWeb\Instagram\Instagram;
$instagram = new Instagram(array(
'apiKey' => 'YOUR_APP_KEY',
'apiSecret' => 'YOUR_APP_SECRET',
'apiCallback' => 'YOUR_APP_CALLBACK'
));
@cosenary
cosenary / Benchmark.java
Last active December 19, 2015 08:59
Simple Benchmark chart class in Java.
/**
* Benchmark chart.
* Fancy benchmark chart generator.
*
* @since 4.04.2013
* @author Christian Metz | christian@metzweb.net
* @version 1.0
*/
class Benchmark {
@cosenary
cosenary / follower.json
Last active December 2, 2020 15:28
Instagram display user follower example.Simply replace the success.php file in the example folder by this one and fill in your API credentials.
{
"username": "moo",
"bio": "We print things.",
"website": "http://www.moo.com",
"profile_picture": "http://images.ak.instagram.com/profiles/profile_7927894_75sq_1378988556.jpg",
"full_name": "MOO Print",
"id": 7927894
}
@cosenary
cosenary / follow.php
Last active December 25, 2020 07:13
Instagram API class - follow user example
<?php
require 'Instagram.php';
use MetzWeb\Instagram\Instagram;
$instagram = new Instagram(array(
'apiKey' => 'YOUR_APP_KEY',
'apiSecret' => 'YOUR_APP_SECRET',
'apiCallback' => 'YOUR_APP_CALLBACK' // must point to success.php
));
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page progress example</title>
<style>
body {
background-color: #fff;
}
#page_progress {
@cosenary
cosenary / index.php
Last active June 17, 2019 15:04
Instagram API login (with sessions)
<?php
require '../src/Instagram.php';
use MetzWeb\Instagram\Instagram;
session_start();
if (isset($_SESSION['access_token'])) {
// user authentication -> redirect to media
header('Location: success.php');