承接 spatie/twitter-oembed 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

spatie/twitter-oembed

Composer 安装命令:

composer require spatie/twitter-oembed

包简介

Retrieve tweets with the Twitter oEmbed API

README 文档

README

Retrieve tweets with the Twitter oEmbed API

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A utility package to retrieve tweets with Twitter's oEmbed API. The main benefit of Twitter's oEmbed API is that it's public. You don't need to set up a developer account to get started, but the data in the response is minimal.

This package is meant to set the stage for tools that embed Tweets. For example, a markdown plugin that embeds tweets as static HTML so your blog doesn't need a bloated JavaScript widget. Or a rich text editor plugin for your email platform so tweets can be embedded in newsletters, like Substack does.

It's still in an experimental stage, I'm not sure what direction this is going to go yet. I don't think it's valuable enough as long as it doesn't support displaying basic data like an image or quoted tweet, which the oEmbed API doesn't return by default.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

composer require spatie/twitter-oembed

Usage

$tweet = (new TwitterOEmbed())->embed(
    'https://twitter.com/AoDespair/status/1173718972103090177'
);

echo $tweet->url;
// "https://twitter.com/AoDespair/status/1173718972103090177"

echo $tweet->name;
// "David Simon"

echo $tweet->username;
// "@AoDespair"

echo $tweet->html;
// "<p>Have I seen The Wire?</p>"

echo $tweet->date;
// 2019-09-16

Alternatives

  • j7mbo/twitter-api-php: A Twitter API wrapper. This returns a lot more data, but requires a developer account.
  • embed/embed: A generic oEmbed package. This supports retrieving oEmbed data from any source, like YouTube or Wikipedia. spatie/twitter-oembed aims to add Twitter specific features like parsing the tweet's date and author metadata.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-06