Module: DiasporaFederation::Federation::DiasporaUrlParser
- Includes:
- Logging
- Defined in:
- lib/diaspora_federation/federation/diaspora_url_parser.rb
Overview
This module is for parsing and fetching linked entities.
Constant Summary collapse
- DIASPORA_URL_REGEX =
Regex to find diaspora:// URLs
%r{ (?:web\+)?diaspora:// (#{Validation::Rule::DiasporaId::DIASPORA_ID_REGEX})/ (#{Entity::ENTITY_NAME_REGEX})/ (#{Validation::Rule::Guid::VALID_CHARS}) }ux.freeze
Class Method Summary collapse
-
.fetch_linked_entities(text) ⇒ Object
Parses all diaspora:// URLs from the text and fetches the entities from the remote server if needed.
Methods included from Logging
Class Method Details
.fetch_linked_entities(text) ⇒ Object
Parses all diaspora:// URLs from the text and fetches the entities from the remote server if needed.
21 22 23 24 25 |
# File 'lib/diaspora_federation/federation/diaspora_url_parser.rb', line 21 def self.fetch_linked_entities(text) text.scan(DIASPORA_URL_REGEX).each do |, type, guid| fetch_entity(, type, guid) end end |