定制 amattu2/vinwiki-wrapper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

amattu2/vinwiki-wrapper

Composer 安装命令:

composer require amattu2/vinwiki-wrapper

包简介

A VINwiki.com API wrapper. Opens up access to VINWiki API functionality; Fetch feeds by a VIN, use plate2vin (pl82vin), add a new event to a feed, etc.

README 文档

README

This is an unofficial and dependency-free VINwiki.com API wrapper written PHP. It offers a simple interface for interacting with the VINwiki API. Among other things, it allows you to:

  • Read and update user profiles
  • Read and update vehicle information
  • Read, create, and delete posts
  • Decode license plates by country and state
  • Search for vehicles by VIN, Year, Make, Model, or free-text

Usage

Installation

Via Composer

composer require amattu2/vinwiki-wrapper

Then, require Composer's autoloader:

require 'vendor/autoload.php';

Instantiate the class:

$wrapper = new amattu2\VINwiki\Client("email|username", "password");

Functions

People

These functions relate to person interactions.

getPersonProfile(string $uuid = "") : ?VINwiki\Models\Person

Returns a VINwiki user profile. If no user is specified, the current user's profile is returned.

// for the current user
print_r($wrapper->getPersonProfile());

// or for a specific user
print_r($wrapper->getPersonProfile("61382da4-25c6-494f-8065-87afdfb4f50d"));
updatePersonProfile(string $uuid, VINwiki\Models\Person $person): ?VINwiki\Models\Person

Updates the current user's profile. Returns the updated profile on success. The only required field is "email".

See Models\Person for more fields.

$person = new amattu2\VINwiki\Models\Person([
  "email" => "abc123@example.com",
]);
print_r($wrapper->updatePersonProfile("{UUID GOES HERE}", $person));
getPersonNotifications() : ?array

Get the current user's notifications.

print_r($wrapper->getPersonNotifications());
getPersonFeed(string $uuid = "", bool $filterFollowing = true): ?Models\PersonFeed

Get a user's post feed. If no $uuid is specified, the current user's feed is returned. If $filterFollowing is true, only the posts for vehicles/people that the specified user is following will be returned.

// for the current user
print_r($wrapper->getPersonFeed());

// or for a specific user
print_r($wrapper->getPersonFeed("61382da4-25c6-494f-8065-87afdfb4f50d", false));
getPersonPosts(string $uuid = ""): ?VINwiki\Models\PersonPosts

Get a user's posts. If no user is specified, the current user's posts are returned.

// for the current user
print_r($wrapper->getPersonPosts());

// or for a specific user
print_r($wrapper->getPersonPosts("61382da4-25c6-494f-8065-87afdfb4f50d"));
getRecentVins(): ?VINwiki\Models\RecentVins

Returns a list of vehicles the user has recently posted on or interacted with. Does not include vehicles that the user has only viewed.

print_r($wrapper->getRecentVins());

Vehicles

These functions handle any vehicle-related interactions.

plateLookup(string $plate, string $country, string $state): ?VINwiki\Models\PlateLookup

Returns a vehicle decoded by the license plate. Currently supports US/UK plates.

print_r($wrapper->plateLookup("HELLO", "US", "CA"));
getFeed(string $vin): ?VINwiki\Models\VehicleFeed

Get a vehicle's post feed (i.e. when you visit a vehicle's page on VINwiki.com)

print_r($wrapper->getFeed("WBAPL33579A406957"));
getVehicle(string $vin): ?VINwiki\Models\Vehicle

Get a vehicle's information by VIN.

print_r($wrapper->getVehicle("WBAPL33579A406957"));
vehicleSearch(string $query): ?VINwiki\Models\VehicleSearch

Perform a free-text search for vehicles by Year, Make, Model, or VIN.

print_r($wrapper->vehicleSearch("2011 Toyota Corolla"));
updateVehicle(string $vin, int $year, string $make, string $model, string $trim = ""): bool

Update a vehicle's Year, Make, Model, and Trim by VIN. Returns true if successful.

print_r($wrapper->updateVehicle("WBAPL33579A406957", 2009, "BMW", "335i", "xDrive"));
createPost(string $vin, VINwiki\Models\VehiclePost $post): ?VINwiki\Models\FeedPost

Create a new post on a vehicle. Requires a VIN and a VehiclePost object. Returns the new post on success.

See Models\VehiclePost for more information.

// Create a new post class
$post = new amattu2\VINwiki\Models\VehiclePost([
  "mileage" => 43000,
  "text" => "This is a test post from the VINwiki-Wrapper PHP library.",
]);

// Post it
print_r($wrapper->createPost("WBAPL33579A406957", $post));
deletePost(string $uuid) : bool

Delete a post by UUID. Returns true if successful. Requires the user to be the author of the post.

print_r($wrapper->deletePost("61382da4-25c6-494f-8065-87afdfb4f50d"));

Requirements

  • PHP 7.4+
  • cURL
  • Composer (Preferred)

amattu2/vinwiki-wrapper 适用场景与选型建议

amattu2/vinwiki-wrapper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 32 次下载、GitHub Stars 达 3, 最近一次更新时间为 2023 年 03 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 amattu2/vinwiki-wrapper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 amattu2/vinwiki-wrapper 我们能提供哪些服务?
定制开发 / 二次开发

基于 amattu2/vinwiki-wrapper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-only
  • 更新时间: 2023-03-09