Returns the image of the Yahoo rss feed as an html string
339561
def as_html(self):
        

        return '<a href="{0}"><img height="{1}" width="{2}" src="{3}" alt="{4}"></a>'.format(
            self.link, self.height, self.width, self.url, self.title)
367396
def create_html(api_key, attrs):
    ''''''
    gif = get_gif(api_key, attrs['gif_id'])

    if 'alt' not in attrs.keys():
        attrs['alt'] = 'source: {}'.format(gif['data']['source'])

    html_out = '<a href="{}">'.format(gif['data']['url'])
    html_out += '<img src="{}" alt="{}">'.format(
        gif['data']['images']['original']['url'],
        attrs['alt'])
    html_out += '</a>'

    return html_out
869894
def to_xml_string(str = '')
      str << '<c:view3D>'
      %w(rot_x h_percent rot_y depth_percent r_ang_ax perspective).each do |key|
        str << element_for_attribute(key, 'c')
      end
      str << '</c:view3D>'
    end
316334
private function getImage()
    {
        $image = $this->_parser->find('#content table tr', 0)->find('td', 0)->find('img', 0);

        return $image ? $image->src : '';
    }
477463
function render($rss)
	{
		if(!class_exists('UniversalFeedCreator'))
			bors_throw("Use:<br/>\ncomposer require openpsa/universalfeedcreator=*");

//		$type = "ATOM1.0";
		$type = "RSS2.0";

		$feed = new UniversalFeedCreator();
		$feed->useCached($type, '/tmp/bors-rss-'.md5($rss->url()).'.xml', config('rss_static_lifetime'));
		$feed->encoding = 'UTF-8';
		$feed->title = $rss->rss_title();
		$feed->description = $rss->rss_description();
		$feed->link = $rss->main_url();
		$feed->syndicationURL = $rss->url();

//		$feed->descriptionTruncSize = 500;
		$feed->descriptionHtmlSyndicated = true;

		if($xmlns = $rss->get('xmlns_append'))
			$feed->xmlns_append = $xmlns;

		if($img_url = $rss->get('rss_image_src'))
		{
			$image = new FeedImage();
			$image->title = $rss->get('rss_image_title');
			$image->url = $img_url;
			$image->link = $rss->get('rss_image_link', $rss->main_url());
			$image->description = $rss->get('rss_image_description');
			$feed->image = $image; 
		}

		foreach(explode(' ', 'copyright docs language') as $n)
			if($x = $rss->get($n))
				$feed->$n = $x;

		foreach($rss->rss_items() as $o)
		{
		    $item = new FeedItem();
	    	$item->title = $rss->item_rss_title($o);
		    $item->link = $rss->item_rss_url($o);
		    $item->guid = $rss->item_rss_guid($o);

//			$item->description = $rss->rss_body($o, $rss->rss_strip());
			if(($desc = $rss->item_rss_body($o, $rss)))
				$item->description = $desc;

			$item->descriptionHtmlSyndicated = true;
			$item->date = intval($o->create_time());//$rss->item_rss_gmtime($o);
			$item->source = $rss->rss_source_url();
			$owner = $o->get('owner');
			if($owner)
				$item->author = $owner->title();

			$item->category = $rss->item_rss_keywords_string($o);

			if($add = $rss->item_additional($o, $rss))
				$item->additionalElements = $add;

/*
			if($e = $rss->item_rss_enclosure($o))
			{
	 			$item->enclosure = new EnclosureItem();
				$item->enclosure->url = $e['url'];
				$item->enclosure->type = $e['type'];
				if($s = @$e['size'])
					$item->enclosure->length = $s;
			}
			if($image = $this->item_image($o, $rss))
			{
				print_dd($image);
				// <link rel="enclosure" type="image/jpeg" href="image_url_here" />
	 			$item->enclosure = new EnclosureItem();
	 			$thumb = $image->thumbnail('300x300');
				$item->enclosure->url = $thumb->url();
				$item->enclosure->length = $thumb->size();
				$item->enclosure->type = $image->mime_type();
			}
*/
			$feed->addItem($item); 
		}

		$result = $feed->createFeed($type);
		@header("Content-Type: ".$feed->contentType."; charset=".$feed->encoding);
		return $result;
	}
640413
protected function renderPinterest()
    {
        $int = 0;

        foreach ($this->feedData as $item) {
            $int++;

            $this->addImage(
                null,
                array(
                    'name' => $item->pinner->full_name,
                    'picture' => $item->pinner->image_small_url
                ),
                $item->images->{'237x'}->url,
                isset($item->description) ? $item->description : null,
                $item->link
            );

            if ($int == $this->args['length']) {
                break;
            }
        }
    }
1328002
def to_s
      out = ''
      desc = ''
      aut = ''
      published = DateTime.parse(posted_at).to_date

      case type
      when 'image'
        desc = data.image.caption
        aut = data.respond_to?(:oembed) ? data.oembed.author_name : attribution.name
      when 'text'
        desc = data.text

        doc = Nokogiri::HTML(desc)
        desc = doc.xpath("//text()").to_s
        desc = desc.gsub(/&[a-z]+;/,'')
      else
        desc = data.send("#{type}".to_sym).description

        aut = source.username
        aut = "@" + aut if source.name.downcase == 'twitter'
      end

      case source.name.downcase
      when 'storify'
        out << "\n#{desc}\n"
        out << ('-' * desc.length) + "\n\n" if desc.length < 40
      when 'twitter'
        out << "[#{published.to_s}] #{aut}: #{permalink}\n"
      else
        out << "#{aut} [#{published.to_s}]: #{permalink}\n"
      end

      out
    end
1022212
function(htmlString) {
        var matchResult;
        htmlString = htmlString.replace(/[\n\r\t]/g, '');
        if (snippet.hasEncodableString(htmlString)) {
            if (/<img/i.test(htmlString)) {
                matchResult = htmlString.match(/<img[^>]*\ssrc=["']?([^>"']+)["']?[^>]*>/i);
                htmlString = matchResult ? matchResult[1] : '';
            } else {
                htmlString = htmlString.replace(/<button.*?<\/button>/gi, '');
            }
            htmlString = $.trim(snippet.decodeHTMLEntity(
                htmlString.replace(/<\/?(?:h[1-5]|[a-z]+(?::[a-z]+)?)[^>]*>/ig, '')
            ));
        }

        return htmlString;
    }
1052028
def image(self):
        ''''''
        r = requests.get(self.image_url, stream=True)
        r.raise_for_status()
        return r.raw.read()
523783
public function imageToHtml()
    {
        if (empty($this->data['file.url'])) {
            return '';
        }

        $text = $this->data['text'] ?? '';

        if (!empty($text)) {
            $text = $this->parser->toHtml($text);
        }

        $url = $this->data['file.url'] ?? '';

        try {
            $size = getimagesize($url);
        } catch (Exception $e) {
            $size = [
                $this->config['image.width'] ?? 520,
                $this->config['image.height'] ?? 200,
            ];
        }

        return $this->view('image.image', [
            'url' => $url,
            'text' => $text,
            'width' => $size[0],
            'height' => $size[1],
        ]);
    }
33569
def _get_html_contents(html):
    """"""
    parser = MyHTMLParser()
    parser.feed(html)
    if parser.is_code:
        return ('code', parser.data.strip())
    elif parser.is_math:
        return ('math', parser.data.strip())
    else:
        return '', ''
115608
def to_xml_string(str = '')
      # macro attribute should be optional!
      str << '<xdr:graphicFrame>'
      str << '<xdr:nvGraphicFramePr>'
      str << ('<xdr:cNvPr id="' << @anchor.drawing.index.to_s << '" name="' << 'item_' << @anchor.drawing.index.to_s << '"/>')
      str << '<xdr:cNvGraphicFramePr/>'
      str << '</xdr:nvGraphicFramePr>'
      str << '<xdr:xfrm>'
      str << '<a:off x="0" y="0"/>'
      str << '<a:ext cx="0" cy="0"/>'
      str << '</xdr:xfrm>'
      str << '<a:graphic>'
      str << ('<a:graphicData uri="' << XML_NS_C << '">')
      str << ('<c:chart xmlns:c="' << XML_NS_C << '" xmlns:r="' << XML_NS_R << '" r:id="' << rId << '"/>')
      str << '</a:graphicData>'
      str << '</a:graphic>'
      str << '</xdr:graphicFrame>'
    end
757408
def getMiniHTML(self):
        '''
            
        '''
        from .Formatter import AdvancedHTMLMiniFormatter
        html = self.getHTML()
        formatter = AdvancedHTMLMiniFormatter(None) # Do not double-encode
        formatter.feed(html)
        return formatter.getHTML()
388898
public function get_image_width()
	{
		if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'width'))
		{
			return round($return[0]['data']);
		}
		elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
		{
			return 88.0;
		}

		return null;
	}
816024
function getImageData(img) {
  let data = null;
  return new Promise((reslove, reject) => {
    if (img.src) {
      if (/^data\:/i.test(img.src)) { // Data URI
        data = base64ToArrayBuffer(img.src);
        reslove(data)
      } else if (/^blob\:/i.test(img.src)) { // Object URL
        var fileReader = new FileReader();
        fileReader.onload = function (e) {
          data = e.target.result;
          reslove(data)
        };
        objectURLToBlob(img.src, function (blob) {
          fileReader.readAsArrayBuffer(blob);
        });
      } else {
        var http = new XMLHttpRequest();
        http.onload = function () {
          if (this.status == 200 || this.status === 0) {
            data = http.response
            reslove(data)
          } else {
            throw "Could not load image";
          }
          http = null;
        };
        http.open("GET", img.src, true);
        http.responseType = "arraybuffer";
        http.send(null);
      }
    } else {
      reject('img error')
    }
  })
}
657762
def to_html(self):
        

        text = self.text
        if text is None:
            text = self.uri
        return '<a href="%s"%s>%s</a>' % (
            self.uri, self.html_attributes(), text)
1070359
public function gettyimagesToHtml()
    {
        return $this->view('image.gettyimages', [
            'remote_id' => $this->data['remote_id'],
            'width' => $this->config['gettyimages.width'] ?? 594,
            'height' => $this->config['gettyimages.height'] ?? 465,
            'placeholder' => $this->config['gettyimages.placeholder'] ?? '/',
        ]);
    }