http://en.wikipedia.org/w/api.php?action=query&format=json&prop=imageinfo&iiprop=url&iiurlwidth=200&titles=File:Albert%20Einstein%20Head.jpg
180205
def request_image( title, options = {} )
      request( {
        action: 'query',
        prop: 'imageinfo',
        iiprop: 'url',
        iiurlwidth: options && options[:iiurlwidth] ? options[:iiurlwidth] : 200,
        titles: title
      }.merge( options ) )
    end
1028239
def image(link, title, alt_text)
      # add the querystring to the image
      if @image_parameters.present?
        prefix = link.include?('?') ? '&' : '?'
        link += "#{prefix}#{@image_parameters.to_query}"
      end
      # return a content tag
      content_tag(:img, nil, src: link.to_s, alt: alt_text, title: title)
    end
1127268
def _get_image_information(self):
        
        result = yield from self.manager.query("GET", "images/{}/json".format(self._image))
        return result
656685
function parse(data){
			var out = {source: 'api'};
        	if(data.ok && data.ok === true){

        		var entry = data.user;

        		if(entry.username){ out.nickname = entry.username };
        		if(entry.name){ out.fn = entry.name };
				if(entry.short_bio){ out.note = [entry.short_bio] };

        		if(entry.web_url){ 
        			if(!out.url) {out.url = []};
        			out.url.push(entry.web_url);
        		};

        		if(entry.twitter_url){ 
        			if(!out.url) {out.url = []};
        			out.url.push(entry.twitter_url);
        		};

				if(entry.avatar_url){ 
				  	var large = entry.avatar_url.replace('s48','s300');
					out.photo = [large] 
				};

			}
			return {type: ['h-card'], properties: out};
		}
517262
def attributions(self):
        """"""
        attributes_list = list()
        attributes_list.append(self.tr(
            'Edit by Hugo Garduño from The Noun Project'))
        attributes_list.append(self.tr(
            '"Add icon" designed by Michael Zenaty from the Noun Project'))
        attributes_list.append(self.tr(
            '"Remove icon" designed by Dalpat Prajapati from the Noun '
            'Project'))
        attributes_list.append(self.tr('Humanitarian icons source: OCHA'))
        attributes_list.append(self.tr(
            '"Sign post" by Tara Swart from the Noun Project'))
        return attributes_list
951181
function PhotoAttribution({ username, name }) {
  if (!username) {
    return null;
  }

  const href = `https://unsplash.com/${username}?utm_medium=referral&amp;utm_campaign=photographer-credit&amp;utm_content=creditBadge`;
  const title = `Download free do whatever you want high-resolution photos from ${name}`;
  return (
    <a className="photo-attribution" href={href} target="_blank" rel="noopener noreferrer" title={title}>
      <span>
        <svg viewBox="0 0 32 32">
          <path d="M20.8 18.1c0 2.7-2.2 4.8-4.8 4.8s-4.8-2.1-4.8-4.8c0-2.7 2.2-4.8 4.8-4.8 2.7.1 4.8 2.2 4.8 4.8zm11.2-7.4v14.9c0 2.3-1.9 4.3-4.3 4.3h-23.4c-2.4 0-4.3-1.9-4.3-4.3v-15c0-2.3 1.9-4.3 4.3-4.3h3.7l.8-2.3c.4-1.1 1.7-2 2.9-2h8.6c1.2 0 2.5.9 2.9 2l.8 2.4h3.7c2.4 0 4.3 1.9 4.3 4.3zm-8.6 7.5c0-4.1-3.3-7.5-7.5-7.5-4.1 0-7.5 3.4-7.5 7.5s3.3 7.5 7.5 7.5c4.2-.1 7.5-3.4 7.5-7.5z"></path>
        </svg>
      </span>
      <span>{name}</span>
    </a>
  );
}
251584
public function iconAction()
    {
        header('Content-Type: image/x-icon');
        // open our file
        $fp = fopen(__DIR__.'/../Resources/assets/favicon.ico', 'r');
        fpassthru($fp);
        fclose($fp);
        exit;
    }
554134
protected function wikidata($input){
    $input = urlencode($input);
    $urlindex =  '&language=en&format=json&search=' . $input;
    $baseurl = 'https://www.wikidata.org/w/api.php?action=wbsearchentities';
    $remoteUrl = $baseurl.$urlindex;

    $options['headers']=['Accept' => 'application/json'];
    $body = $this->getRemoteJsonData($remoteUrl, $options);

    $jsondata = [];
    $results = [];
    $jsondata = json_decode($body, TRUE);
    $json_error = json_last_error();
    if ($json_error == JSON_ERROR_NONE) {
      //WIKIdata will give is an success key will always return at least one, the query string
      if (count($jsondata) > 1) {
        if ($jsondata['success'] == 1) {
          foreach ($jsondata['search'] as $key => $item) {
            $desc = (isset($item['description'])) ? '('.$item['description'].')':'';
            $results[] = [
              'value' => $item['concepturi'],
              'label' => $item['label'].' '.$desc,
              'desc' => $desc,
            ];
          }
        }
      }
      else {
        $results[] = [
          'value' => NULL,
          'label' => 'Sorry no Match from Wikidata Subject Headings'
        ];
      }
      return  $results;
    }
    $this->messenger->addError(
      $this->t('Looks like data fetched from @url is not in JSON format.<br> JSON says: @$jsonerror <br>Please check your URL!',
        [
          '@url' => $remoteUrl,
          '@$jsonerror' => $json_error
        ]
      )
    );
    return [];
  }
1328435
def info(self):
        """"""
        return {'coordinates': self._coordinates(),
                'imageinfo': self._imageinfo(),
                'miscinfo': self._miscinfo(),
                'unit': self._unit()
                }
287604
def generate_html(attrs, api_key):
    '''  '''
    # getting flickr api data
    flickr_data = get_info(attrs['photo_id'], api_key)

    # if size is not defined it will use large as image size
    if 'size' not in attrs.keys():
        attrs['size'] = 'large'

    # if no alt is defined it will use the flickr image title
    if 'alt' not in attrs.keys():
        attrs['alt'] = flickr_data['photo']['title']['_content']

    # return final html code
    return '<a href="{}"><img src="{}" alt="{}"></a>'.format(
        flickr_data['photo']['urls']['url'][0]['_content'],
        source_url(flickr_data['photo']['farm'],
                   flickr_data['photo']['server'],
                   attrs['photo_id'],
                   flickr_data['photo']['secret'],
                   attrs['size']),
        attrs['alt'])
1121435
def put_changes_images_with_http_info(request)
      raise ArgumentError, 'Incorrect request type' unless request.is_a? PutChangesImagesRequest

      @api_client.config.logger.debug 'Calling API: ChangesApi.put_changes_images ...' if @api_client.config.debugging
      # resource path
      local_var_path = '/comparison/compareDocuments/changes/images'

      # query parameters
      query_params = {}
      if local_var_path.include? ('{' + downcase_first_letter('OutFolder') + '}')
        local_var_path = local_var_path.sub('{' + downcase_first_letter('OutFolder') + '}', request.out_folder.to_s)
      else
        query_params[downcase_first_letter('OutFolder')] = request.out_folder unless request.out_folder.nil?
      end

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(request.request)
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
                                                        header_params: header_params,
                                                        query_params: query_params,
                                                        form_params: form_params,
                                                        body: post_body,
                                                        access_token: get_access_token,
                                                        return_type: 'Array<Link>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called:
        ChangesApi#put_changes_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      [data, status_code, headers]
    end
284267
function imageStatus($key, $url) {
        $request = curl_init();
        curl_setopt_array($request, $this->options);
        //$this->prepareJSONRequest(self::API_STATUS_ENDPOINT(), $request, array('key' => $key), 'post', array());
        curl_setopt($request, CURLOPT_URL, self::IMAGE_STATUS_ENDPOINT());
        curl_setopt($request, CURLOPT_CUSTOMREQUEST, 'POST');
        curl_setopt($request, CURLOPT_HTTPHEADER, array());
        $params = array('key' => $key, 'url' => $url);
        curl_setopt($request, CURLOPT_POSTFIELDS, json_encode($params));
        return $this->sendRequest($request, 1);
    }
1263901
function( data, url ) {
        // Version 2.0 and forwards
        if (data.protocol && data.protocol == 'http://iiif.io/api/image') {
            return true;
        // Version 1.1
        } else if ( data['@context'] && (
            data['@context'] == "http://library.stanford.edu/iiif/image-api/1.1/context.json" ||
            data['@context'] == "http://iiif.io/api/image/1/context.json") ) {
            // N.B. the iiif.io context is wrong, but where the representation lives so likely to be used
            return true;

        // Version 1.0
        } else if ( data.profile &&
            data.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html") === 0) {
            return true;
        } else if ( data.identifier && data.width && data.height ) {
            return true;
        } else if ( data.documentElement &&
            "info" == data.documentElement.tagName &&
            "http://library.stanford.edu/iiif/image-api/ns/" ==
                data.documentElement.namespaceURI) {
            return true;

        // Not IIIF
        } else {
            return false;
        }
    }
1273820
public function index()
    {
        $oUri      = Factory::service('Uri');
        $string    = $oUri->segment(2) ?: '';
        $width     = $oUri->segment(3) ?: null;
        $height    = $oUri->segment(4) ?: null;
        $cacheFile = 'BARCODE-' . $string. '-' . $width . 'x' . $height . '.png';

        // 

        /**
         * Check the request headers; avoid hitting the disk at all if possible. If
         * the Etag matches then send a Not-Modified header and terminate execution.
         */

        if ($this->serveNotModified($cacheFile)) {

            return;
        }

        // 

        /**
         * The browser does not have a local cache (or it's out of date) check the cache
         * to see if this image has been processed already; serve it up if it has.
         */

        if (file_exists($this->cacheDir . $cacheFile)) {

            $this->serveFromCache($cacheFile);

        } else {

            //  Generate and save to cache
            $oGenerator = Factory::service('Generator', 'nails/module-barcode');
            $result = $oGenerator->save($string, $this->cacheDir . $cacheFile, $width, $height);

            if ($result) {

                $this->serveFromCache($cacheFile);

            } else {

                header('Cache-Control: no-cache, must-revalidate', true);
                header('Expires: Mon, 26 Jul 1997 05:00:00 GMT', true);
                header('Content-Type: application/json', true);
                header($this->input->server('SERVER_PROTOCOL') . ' 400 Bad Request', true, 400);

                // 

                $out = array(
                    'status'  => 400,
                    'message' => 'Failed to generate barcode.',
                    'error'   => $oGenerator->lastError()
                );

                echo json_encode($out);

                // 

                /**
                 * Kill script, th, th, that's all folks.
                 * Stop the output class from hijacking our headers and
                 * setting an incorrect Content-Type
                 **/

                exit(0);
            }
        }
    }
1370018
def __getAvatar(self, web):
        
        try:
            self.avatar = web.find("img", {"class": "avatar"})['src'][:-10]
        except IndexError as error:
            print("There was an error with the user " + self.name)
            print(error)
        except AttributeError as error:
            print("There was an error with the user " + self.name)
            print(error)
457658
def uploaded_file_info(self, key):
        
        r = requests.get(FILE_UPLOAD_STATUS_ENDPOINT + key)
        if r.status_code != 200:
            raise GfycatClientError('Unable to check the status',
                                    r.status_code)

        return r.json()
228447
function(params, callback) {
                getImageData = {};

                if (params) {
                    if (parseInt(params.imageId) > 0) {
                        getImageData.imageId = params.imageId;
                    }

                    if (typeof params.hashCode == 'string') {
                        getImageData.hashCode = params.hashCode;
                    }

                    if (parseInt(params.width) > 0) {
                        getImageData.width = params.width;
                    }

                    if (parseInt(params.height) > 0) {
                        getImageData.height = params.height;
                    }

                    if (parseInt(params.actual) > 0) {
                        getImageData.actual = params.actual;
                    }

                    if (parseInt(params.downloadable) > 0) {
                        getImageData.downloadable = params.downloadable;
                    }
                }

                httpRequest({
                    url: SERVICE_ADDRESSES.FILESERVER_ADDRESS + SERVICES_PATH.GET_IMAGE,
                    method: 'GET',
                    data: getImageData
                }, function(result) {
                    if (!result.hasError) {
                        var queryString = '?';
                        for (var i in params) {
                            queryString += i + '=' + params[i] + '&';
                        }
                        queryString = queryString.slice(0, -1);
                        var image = SERVICE_ADDRESSES.FILESERVER_ADDRESS + SERVICES_PATH.GET_IMAGE + queryString;
                        callback({
                            hasError: result.hasError,
                            result: image
                        });
                    }
                    else {
                        callback({
                            hasError: true
                        });
                    }
                });
            }