Title: Can you supply code without using it with wordpress?
Last modified: March 20, 2019

---

# Can you supply code without using it with wordpress?

 *  Resolved [owenpiccirillo](https://wordpress.org/support/users/owenpiccirillo/)
 * (@owenpiccirillo)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/can-you-supply-code-without-using-it-with-wordpress/)
 * Hello,
 * I have been using a php script I made with access token that displays the latest
   instagram pics on my site.
 * However starting a week ago, instagram is either crashing or servers are having
   issues, and now my website “hangs” for 10 seconds before it loads up trying to
   retrieve the data… it works but the website takes way to long to load up.
 * here is the code..
 *  <?php
 *  function linkify_instagram($status_text){
 *  $status_text = preg_replace(
    ‘/(https?:\/\/\S+)/’, ‘\1‘, $status_text );
 *  $status_text = preg_replace(
    ‘/(^|\s)@(\w+)/’, ‘\1[@\2](http://instagram.com/)‘,
   $status_text );
 *  return $status_text;
    }
 *  $url = “[https://api.instagram.com/v1/users/XXXXXXXX/media/recent?count=8&access_token=XXXXXXXXXXXXX&#8221](https://api.instagram.com/v1/users/XXXXXXXX/media/recent?count=8&access_token=XXXXXXXXXXXXX&#8221);;
 *  if ( isset($_GET[“next_max_id”]) ) {
    $url .= “&max_id=” . $_GET[“next_max_id”];}
 *  $data = json_decode(file_get_contents($url));
 *  $arr = (array)$data->data;
 *  for ( $i=0; $i<count($arr); $i++ ) {
 *  if($i<12){
    $post = $arr[$i];
 * $postEdited = $post->images->standard_resolution->url;
    ?>
 *  <div class=”insta-square” >
    <div class=”insta-post” style=”background-image:
   url(<?= $postEdited ?>)”>link; ?>” target=”_blank”>/img/instagram-clear.png”>
   
   </div><div class=”clr”></div>
    </div>
 *  <?php }} ?>
 * Another website I have uses your plugin, and it pops right up, even without the
   access token!
 * I was trying to look at the plugin raw code but was unable to decipher it…. do
   you have any examples or documentation of just the raw code working by just changing
   out the username? ( not wordpress site )
 * I would appreciate it!
 * Thanks
    -O
    -  This topic was modified 7 years, 2 months ago by [owenpiccirillo](https://wordpress.org/support/users/owenpiccirillo/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/can-you-supply-code-without-using-it-with-wordpress/#post-11367498)
 * I am sorry but this is far outside the scope of this support forum.
 * The `scrape_instagram` function should be fairly portable but it relies on WordPress
   caching functions.

Viewing 1 replies (of 1 total)

The topic ‘Can you supply code without using it with wordpress?’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-instagram-widget_d7eadd.svg)
 * [WP Instagram Widget](https://wordpress.org/plugins/wp-instagram-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-instagram-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-instagram-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-instagram-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-instagram-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-instagram-widget/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/can-you-supply-code-without-using-it-with-wordpress/#post-11367498)
 * Status: resolved