indieweb/original-post-discovery 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

indieweb/original-post-discovery

Composer 安装命令:

composer require indieweb/original-post-discovery

包简介

Functions for doing original post discovery in PHP

README 文档

README

A set of PHP functions for determining the canonical URL for a post, given a POSSEd copy. A partial implementation of the algorithm outlined at original-post-discovery.

A demo can be found on waterpigs.co.uk/services/original-post.

Usage

Install using Composer ./composer.phar require indieweb/original-post-discovery:dev-master.

<?php

require __DIR__ . '/vendor/autoload.php';

list($url, $err) = IndieWeb\discoverOriginalPost('https://twitter.com/BarnabyWalters/status/423465842148671488');
if ($err !== null) {
	// handle HTTP errors here
}

// do stuff (e.g. auto-fill in-reply-to form controls) with $url

Other functions

  • string $str = cleanString($str) cleans up a bunch of weird encoding and character issues which can occur, specifically converting non-breaking space codepoints into normal spaces to handle some Twitter.com bugs
  • string|null $url = originalPostUrlFromTwitter($html) is a pure function for parsing HTML from Twitter.com and looking in it for trailing URLs
  • string $str = stripHashtags($str) removes hashtags from a string
  • string|null $url = getTrailingUrl($str) finds parenthesised (text text. (http://example.com)) or ellipsis (text text… http://example.com) trailing URLs in a string
  • string|null $str = getUrlFromPermashortid($str) looks for a trailing permashortid ((cctld.me id)) and converts it into a URL (assumes HTTP)

Testing

A small PHPUnit test suite is provided — if making contributions please at least ensure that all the existing tests pass before/after your changes are made. If you could add new tests to cover the code you added that would be great too.

Version History

0.1.0 2014-01-20

  • Initial extraction from Taproot, readme and basic test suite

统计信息

  • 总下载量: 38
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 14
  • Forks: 2
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-01-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固