项目作者: hypeJunction

项目描述 :
Extraction and embed services
高级语言: PHP
项目地址: git://github.com/hypeJunction/hypeScraper.git
创建时间: 2014-08-20T18:15:59Z
项目社区:https://github.com/hypeJunction/hypeScraper

开源协议:

下载


hypeScraper

Elgg 2.3

A tool for scraping, caching and embedding remote resources.

Features

  • Scrapes URLs and turns them in responsive preview cards
  • Aggressive caching of scraped resources for enhanced performance
  • Linkifies #hashtags, @usernames, links and emails

Card view
Card mobile
Player

Developer notes

Card

To display a URL card with an image preview, title and brief description, use output/card view:

  1. echo elgg_view('output/card', array(
  2. 'href' => 'https://www.youtube.com/watch?v=Dlf1_vuIR4I',
  3. ));

Player

To dipslay a rich media player use output/player view:

  1. echo elgg_view('output/player', array(
  2. 'href' => 'https://www.youtube.com/watch?v=Dlf1_vuIR4I',
  3. ));

Linkify

To linkify all URLs, usernames, emails and hashtags that are not wrapped in html tags, use output/linkify view.
Pass your text in a value parameter. You can use parse_ flags to skip certain qualifiers.

  1. $text = '@someone needs to #linkify this article http://example.com and email it to someone@example.com';
  2. if (elgg_view_exists('output/linkify')) {
  3. $text = elgg_view('output/linkify', array(
  4. 'value' => $text,
  5. //'parse_urls' => false,
  6. //'parse_hashtags' => false,
  7. //'parse_usernames' => false,
  8. //'parse_emails' => false,
  9. ));
  10. }

To generate a preview for multiple URLs extracted from text, use output/url_preview view.
Pass your text as a value parameter. The view will parse all URLs and generate previews.

  1. $text = 'This video is really cool https://vimeo.com/channels/staffpicks/116498390';
  2. if (elgg_view_exists('output/url_preview')) {
  3. $text = elgg_view('output/url_preview', array(
  4. 'value' => $text,
  5. ));
  6. }