GET /links/:slug
433880
def link_detail(slug)
      slug = slug.slug if slug.instance_of? Instamojo::Link
      get("links/#{slug}")
      @response.success? ? Instamojo::Link.new(@response.body[:link], self) : @response
    end
1026274
def get(url, options = {})
      if @auto_paginate
        paginate :get, url, parse_query_and_convenience_headers(options)
      else
        request :get, url, parse_query_and_convenience_headers(options)
      end
    end
246222
def _relIndexLink(self):
        """"""
        return os.path.join("..", os.path.basename(self.pathname), "index.html")
770222
def get(*args)
      arguments(args, required: [:name])

      name = arguments.name
      response = list.body._links[name]
      if response
        params = arguments.params
        params['accept'] = response.type
        get_request(response.href, params)
      end
    end
523924
def get_permalink_path(self):
    """"""
    try:
        first_permalink_id = next(self.get_permalink_ids_iter())
    except StopIteration:
        return None

    return '/{settings[PERMALINK_PATH]}/{first_permalink}.html'.format(
        settings=self.settings, first_permalink=first_permalink_id)
1020143
def rel_links(cls, page):
    """"""
    for match in cls.REL_RE.finditer(page):
      href, rel = match.group(0), match.group(1)
      if rel not in cls.REL_TYPES:
        continue
      href_match = cls.HREF_RE.search(href)
      if href_match:
        href = cls.href_match_to_url(href_match)
        parsed_href = urlparse(href)
        if any(parsed_href.path.endswith(ext) for ext in cls.REL_SKIP_EXTENSIONS):
          continue
        yield href
217495
def get_category(self, slug):
        
        try:
            return get_category_for_slug(slug)
        except ObjectDoesNotExist as e:
            raise Http404(str(e))
1307937
def pagination_link(relation)
      # split on ',' select the [url] in '<[url]>; rel="[relation]"', compact to all url's found (at most one) and take the first
      (@pagination_links ||= {})[relation] ||= @response.header['Link'] && @response.header['Link'].split(/,\s*<?/).map{ |link| link[/^\s*<?(.*?)>?;\s*rel="#{relation.to_s}"\s*$/, 1] }.compact.first
    end
1144546
def links(self):
        """"""
        # <https://example.com/?page=2>; rel="next", <https://example.com/?page=34>; rel="last"'
        # becomes
        # {
        #     'last': {'rel': 'last', 'url': 'https://example.com/?page=34'},
        #     'next': {'rel': 'next', 'url': 'https://example.com/?page=2'},
        # },
        result = {}
        if 'Link' in self.headers:
            value = self.headers['Link']

            for part in re.split(r', *<', value):
                link = {}
                vs = part.split(';')

                # First section is always an url.
                link['url'] = vs.pop(0).strip('\'" <>')

                for v in vs:
                    if '=' in v:
                        key, v = v.split('=')
                        link[key.strip('\'" ')] = v.strip('\'" ')

                rkey = link.get('rel') or link['url']
                result[rkey] = link

        return result
824859
def get_new_links(self, url, resp):
        """"""
        links_on_page = resp.xpath('//a/@href')
        links = [utils.clean_url(u, url) for u in links_on_page]

        # Remove non-links through filtering by protocol
        links = [x for x in links if utils.check_protocol(x)]

        # Restrict new URLs by the domain of the input URL
        if not self.args['nonstrict']:
            domain = utils.get_domain(url)
            links = [x for x in links if utils.get_domain(x) == domain]

        # Filter URLs by regex keywords, if any
        if self.args['crawl']:
            links = utils.re_filter(links, self.args['crawl'])
        return links
699919
def get_by_slug(self, slug):
        
        response = self.requester.get(
            '/{endpoint}/by_slug?slug={slug}',
            endpoint=self.instance.endpoint,
            slug=slug
        )
        return self.instance.parse(self.requester, response.json())
1231009
def clean_link(self, url):
        """"""
        return self._clean_re.sub(lambda match: "%%%2x" % ord(match.group(0)), url)
300875
def derive_single_object_url_pattern(slug_url_kwarg, path, action):
    
    if slug_url_kwarg:
        return r'^%s/%s/(?P<%s>[^/]+)/$' % (path, action, slug_url_kwarg)
    else:
        return r'^%s/%s/(?P<pk>\d+)/$' % (path, action)
104057
def get_post(self, slug):
        
        cache_key = self.get_cache_key(post_slug=slug)
        content = cache.get(cache_key)
        if not content:
            post = Post.objects.get(slug=slug)
            content = self._format(post)
            cache_duration = conf.GOSCALE_CACHE_DURATION if post else 1
            cache.set(cache_key, content, cache_duration)
        return content
1051522
function(permalink) {
    permalink = permalink || '';
    if (permalink.slice(0, 1) !== PATH_SEP) {
      permalink = PATH_SEP + permalink;
    }
    permalink = permalink.replace(INDEX_RE, PATH_SEP);
    return permalink;
  }
366779
protected function _get($slug = '')
    {
        // Build a url from the slug that was passed in
        $url = $this->urlFromRoute($slug);
        // Send a post request to the API
        $response = $this->orm->uniRequest->get($url, $this->orm->headers);
        // If the token has expired
        if ($response->code == 401) {
            if (isset($response->body->message)) {
                if ($response->body->message == 'Token has expired') {
                    // Authenticate again
                    $this->orm->authenticate();
                    // Try the request again
                    return $this->_get($slug);
                }
            }
            // Return the response
            return $response;
        } else {
            // Return the response
            return $response;
        }
    }
126764
public static function getISOBySlug($slug)
    {
        $data = collect(self::ISOlist());
        return $data->where('slug', $slug)->first();
    }