Skip to content

Instantly share code, notes, and snippets.

Christian Metz cosenary

  • Munich, Germany
Block or report user

Report or block cosenary

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cosenary
cosenary / index.php
Last active Jun 17, 2019
Instagram API login (with sessions)
View index.php
<?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');
@cosenary
cosenary / index.php
Last active Jun 14, 2019
Instagram PHP API - Likes
View index.php
<?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 / follower.json
Last active Feb 13, 2019
Instagram display user follower example.Simply replace the success.php file in the example folder by this one and fill in your API credentials.
View follower.json
{
"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 / success.php
Last active Jul 30, 2018
Instagram PHP API - How to get the most recent media published by an Instagram user.
View success.php
<?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 / follow.php
Last active Jul 23, 2018
Instagram API class - follow user example
View follow.php
<?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
));
@cosenary
cosenary / README.markdown
Last active Dec 29, 2017
Instagram PHP API - Working example: Load more button (AJAX)
View README.markdown

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 / usermedia.php
Last active May 26, 2017
Load user's public Instagram media
View usermedia.php
<?php
/**
* Instagram PHP API
* Example for using the getUserMedia() method
*
* @link https://github.com/cosenary/Instagram-PHP-API
* @author Christian Metz
* @since 4.04.2014
*/
View page-progress.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page progress example</title>
<style>
body {
background-color: #fff;
}
#page_progress {
@cosenary
cosenary / ratelimit.php
Created Nov 8, 2014
Instagram PHP API - Receive ratelimit header
View ratelimit.php
<?php
/**
* Instagram PHP API
*
* @link https://github.com/cosenary/Instagram-PHP-API
* @author Christian Metz
* @since 8.11.2014
*/
@cosenary
cosenary / instagramproxy.php
Created Apr 6, 2015
Instagram OAuth proxy
View instagramproxy.php
<?php
// Registered Instagram redirect URI: http://example.com/instagramproxy.php
// Custom YOUR_APP_CALLBACK redirect URI: http://example.com/instagramproxy.php?redirect=http://foo.com
// receive OAuth code parameter
$code = $_GET['code'];
$redirectHost = $_GET['redirect'];
$instagramEndpoint = $redirectHost . "/success.php?code=" . $code;
You can’t perform that action at this time.