andreinocenti/social-media-url-id-extractor-php
最新稳定版本:v1.0.7
Composer 安装命令:
composer require andreinocenti/social-media-url-id-extractor-php
包简介
Exctract the id from a Social Media URL
README 文档
README
Social Media URL ID Extractor is a lightweight, intuitive PHP package that automatically detects the provider and resource type from any social media URL and extracts the corresponding identifier (ID). No more writing complex regex or handling each platform manually—just pass the URL and receive back the ID.
🚀 Main Features
- Automatic provider detection: Identifies platforms like Instagram, Facebook, X (Twitter), YouTube, TikTok, LinkedIn, and more
- Resource type classification: Profiles, posts, videos, reels, tweets, playlists, pins, etc.
- Accurate ID extraction: Returns only the unique identifier (e.g.,
ABC123XYZ,1234567890) - Single, simple API:
$result = (new SocialMediaUrlIdExtractor())->extract(string $url) - Supports shortened URLs and UTM query parameters
- Extensible: Easily add new providers to support additional platforms
📦 Installation
composer require andreinocenti/social-media-url-id-extractor-php ## Basic Usage ```php use AndreInocenti\SocialMediaUrlIdExtractor\SocialMediaUrlIdExtractor; // Extract ID from a URL $result = (new SocialMediaUrlIdExtractor())->extract('https://www.instagram.com/p/ABC123XYZ/'); echo $result->id; // Outputs: ABC123XYZ echo $result->provider; // Outputs: Instagram echo $result->resourceType; // Outputs: post
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-18