sahusoftcom / articlebuilder-net-laravel

ArticleBuilder.net API & XMLRPClient WordPress 博客发布服务提供商

v1.4 2016-05-02 13:18 UTC

This package is auto-updated.

Last update: 2024-09-08 17:25:24 UTC


README

ArticleBuilder.net API & XMLRPClient WordPress for Laravel PHP 框架服务提供商 [ Packagist ]

安装

在您的项目目录中输入以下命令

composer require sahusoftcom/articlebuilder-net-laravel

或者

将以下行添加到 composer.json 文件的 require 部分

{
    "require": {
        "sahusoftcom/articlebuilder-net-laravel": "dev-master"
    }
}

设置

/config/app.php 中,将以下内容添加到 providers

SahusoftCom\ArticleBuilder\ArticleBuilderProvider::class

使用方法

  1. 您应该使用 ArtileBuilderService 来访问其功能
  2. ArticleBuilderService 类中传递 usernamepassword 参数
  3. 您应该使用 XMLRPClientWordpress 来访问其功能
  4. XMLRPClientWordpress 类中传递 xmlrpccurlusernamepassword 参数

例如

<?php
namespace App;
 
use SahusoftCom\ArticleBuilderService;
use SahusoftCom\XMLRPClientWordpress;

class NewService
{	
	// Example to use ArticleBuilder Service
	public function firstMethod()
	{
		$object = new ArticleBuilderService($username, $password);
		$object->authenticate();
	}
	
	// Example to use XMLRPClientWordpress Service
	public function secondMethod()
	{
		$object = new XMLRPClientWordpress($xmlrpccurl, $username, $password);
		$blogId = $object->createPost($title, $body, $category, $keywords, $encoding);
	}

文章构建器服务功能

  1. authenticate

    function: authenticate()

    require: 该函数不需要任何参数。

    返回

    [Variable]   	[Value]
    	success		true
    	session		(a unique session id)
    

    会话 ID 不需要在每次调用时保存或传递。

  2. buildArticle :

    构建文章功能验证用户并获取所需的文章。

    function: article($dataArray)

    require: dataArray 包含以下键和值

    [Key]			[Value]
    action			buildArticle
    subtopics		OPTIONAL (the subtopics to include in)
    category		(the category to build an article in)
    wordcount		(the target wordcount (min = 300, max = 1000)
    lsireplacement	(set to 1 if you want automatic LSI replacement performed currency on the article)
    superspun		(1 to use Super Spun content, 2 to use Expanded Super Spun Content, 0 to use unspun content)
    spintogether	OPTIONAL (if the value is 1, the number of articles specified in 'count' will be generated & spun together in one big document.)
    counts 			OPTIONAL (the number of documents to create and spin together)
    customkeys 		OPTIONAL (use custom keyword replacement)
    customkeyslist	OPTIONAL (list of custom keyword replacements, separated by a line break)
    spin 			OPTIONAL (0 = No[default], 1 = Yes -- spin content using) the BestSpinner API
    phrasesonly		OPTIONAL (0 = No[default], 1 = Yes -- only spin phrases in the article with TBS the BestSpinner API
    generatenow		OPTIONAL (0 = No [default], 1= Yes -- return a randomly spun version of content)
    paracount		OPTIONAL (0 = Don't try to keep paragraph counts the same [default], 1 = Make sure all articles have the same number of pargraphs
    

    重要提示: 如果您选择同时旋转多篇文章,每生成一篇文章将消耗一个配额点。也就是说,如果您将 'spintogether' 设置为 1 并将 'count' 设置为 5,则每天将消耗 5 个配额点。

    Returns:
    	[Variable]   	[Value]
    		output 		(article)
    		success		true
    		session		(a unique session id)
    
  3. injectContent :

    注入内容功能验证用户并执行内容注入。

    function: article($dataArray)

    require: dataArray 包含以下键和值

    [Key]					[Value]
    action					injectArticle
    article 				(the article to inject content into)
    category				(the category to build an article in)
    keywords 				OPTIONAL (to get tips containing specific keywords)
    volume					(amount of content to add: 1 = A Lot, 2 = Quit A Bit, 3 = A Little)
    style 					(1 = Inside The Content, 2 = As Sidebar "Tips", 3 = Inside and Sidebar, 4 = In-Line Callout, 5 = Inside and Callout)
    superspun				(1 to use Super Spun content, 2 to use Expanded Super Spun content, 0 to use unspun content -- not yet available for all categories)
    sidebarBackgroundColor	OPTIONAL (the HTML background color of the tips sidebar; default is "FFFFCC")
    sidebarCaption 			OPTIONAL (the caption to use in the sidebar; default is "TIP!")
    sidebarCaptionColor		OPTIONAL (the foreground color of the caption; default is "red")
    sidebarTipColor 		OPTIONAL (the foreground color of the tip text; default is "black")
    spin 					OPTIONAL (0 = No [default], 1 = Yes -- spin content using The Best Spinner API)
    phrasesonly				OPTIONAL(0 = No [default], 1 = Yes -- only spin phrases in the article with TBS)
    generatenow 			OPTIONAL(0 = No [default], 1 = Yes -- return a randomly spun version of content)
    
  4. superSpun :

    从指定类别中随机选择的超级旋转文档生成文章。

    function: article($dataArray)

    require: dataArray 包含以下键和值

    	[Key]				[Value]
    	action				superSpun
    	category			(the category to generate an article for)
    
  5. getTip :

    从给定的类别中返回一条提示。非常适合用作博客文章评论或其他较短的回链文本。

    function: article($dataArray)

    require: dataArray 包含以下键和值

    [Key]				[Value]
    action				getTip
    category			(the category to generate an article for)
    keywords			(attempt to return a tip containing the provided keywords)
    superspun			(1 to use Super Spun Content, 2 for Expanded Super Spun, 0 for all content)
    spin				OPTIONAL (0 = No [default], 1 = Yes -- spin content using The Best Spinner API)
    phrasesonly			OPTIONAL(0 = No [default], 1 = Yes -- only spin phrases in the article with TBS)
    generatenow			OPTIONAL(0 = No [default], 1 = Yes -- return a randomly spun version of content)
    
  6. blogAdd :

    将新的配置博客添加到用户的账户中。如果已存在描述匹配的博客,则更新其详细信息。

    function: addDeleteBlog($dataArray)

    require: dataArray 包含以下键和值

    [Key]				[Value]
    action				blogAdd
    description			(a unique description for the blog)
    url					(the blog URL)
    username			(the blog username)
    password			(the blog password)
    
  7. blogDelete :

    从用户的账户中删除博客(以及与该博客相关联的所有自动发布作业)。

    function: addDeleteBlog($dataArray)

    require: dataArray 包含以下键和值

    [Key]			[Value]
    action			blogDelete
    description		(the description of the blog to delete)
    
  8. createBlogPostJob :

    为传递的博客在用户的账户中创建自动发布作业。作业 ID 返回在输出参数中,用于删除作业或按需创建自动发布(使用 doAutoPost API 调用)。

    function: blogPostJob($dataArray)

    require: dataArray 包含以下键和值

    [Key]			[Value]
    action 			createBlogPostJob
    blog			(the description of the blog to create the job for)
    category		(the category to post an article from -- multiple categories can be used by separating the categories with a pipe character (|). If multiple categories are provided, one will be randomly selected to post from each time the job gets called)
    blogcategory	(the blog category to put the post in--use the full category name)
    wordcountmin	(the minimum number of words the posted article should have: 300 is the absolute minimum, 1000 is the absolute maximum)
    wordcountmax	(the maximum number of words the posted article should have: 300 is the absolute minimum, 1000 is the absolute maximum)
    frequency		(an integer value representing the number of seconds in between posts -- minimum is 28800, or about three posts per day. Note that the posting time will not be exact, as it is adjusted automatically to cause posts to be more random in appearance)
    genericresource	OPTIONAL (0 = no generic resource box [default], 1 = use generic resource box)
    genericlinks	OPTIONAL (required if genericresource is 1 -- see auto-posting details page for full description of this option)
    lsireplacement	OPTIONAL (0 = no LSI replacement [default], 1 = use LSI replacement in supported categories)
    addheadings		OPTIONAL (0 = don't add headings to the post [default], 1 = add headings to the post)
    addimages		OPTIONAL (0 = don't add an image to the post [default], 1 = add an image to the post)
    addyoutube		OPTIONAL (0 = don't add a youtube video to the post [default], 1 = add an youtube video to the post)
    addinjection	OPTIONAL (0 = don't inject additional content into the post [default], 1 = inject additional content)
    addclickbank	OPTIONAL (0 = don't add Clickbank ad links to the post [default], 1 = add Clickbank ad links to the post)
    cbusername		OPTIONAL (required if addclickbank = 1 -- ClickBank username to use in CB ad links)
    customkeys		OPTIONAL (0 = don't perform custom keyword replacement [default], 1 = perform custom keyword replacement)
    customkeyslist	OPTIONAL (required if customkeys = 1 -- data for custom keyword replacement -- see auto-posting details page for full description of this option)
    injectstyle		OPTIONAL (1 = inside the content, 2 = as sidebar "tips" [default], 3 = both inside and sidebar, 4 = as in-line "callouts", 5 = both inside and callouts)
    injectsidebar	OPTIONAL (description of user-saved sidebar configuration to format injected content with)
    injectqty		OPTIONAL (1 = A lot, 2 = Quite a bit, 3 = A little [default])
    resource		OPTIONAL (resource box, nested spinning supported)
    comments		OPTIONAL (0 = don't allow comments on the post [default], 1 = allow comments on the post)
    pingbacks		OPTIONAL (0 = don't allow pingbacks on the post [default], 1 = allow pingbacks on the post)
    draft			OPTIONAL (0 = immediately publish the post [default], 1 = post as a draft)
    
  9. deleteBlogPostJob :

    从用户的账户中删除自动发布作业。

    function: blogPostJob($dataArray)

    require: dataArray 包含以下键和值

    [Key]			[Value]
    action			deleteBlogPostJob
    id				(the blog posting job id)
    
  10. doAutoPost :

    按需运行指定的自动发布作业,将内容发布到配置的博客。如果成功,XMLRPC 返回的发布 URL 将返回在输出变量中。

    function: blogPostJob($dataArray)

    require: dataArray 包含以下键和值

    [Key]			[Value]
    action			doAutoPost
    id				(the blog posting job id to run)
    
  11. createUniquePostJob

    为传递的博客在用户的账户中创建唯一内容自动发布作业。作业 ID 返回在输出参数中,用于删除作业或按需创建自动发布(使用 doUniqueAutoPost API 调用)。

    function: unqiuePostJob($dataArray)

    require: dataArray 包含以下键和值

    [Key]			[Value]
    action			createUniquePostJob
    blog			(the description of the blog to create the job for)
    apikey			(your iNeedArticles.com API key)
    keywords		(the keywords to order articles for -- multiple keywords can be used by separating the keywords with a newline character. If multiple keywords are provided, one will be randomly selected to post from each time the job gets called)
    exactkeys		(0 = Do not require exact keywords in ordered articles [Default], 1 = Require exact keywords in ordered articles)
    bestwriters		(0 = Any iNeedArticles writer is allowed [default], 1 = only 4 or 5 star writers allowed (more expensive))
    extraresearch	(0 = No extra research fee [default], 1 = Add extra research fee (more in-depth articles, but more expensive))
    blogcategory	(the blog category to put the post in--use the full category name)
    wordcountmin	(the minimum number of words the posted article should have: 100 is the absolute minimum, 1000 is the absolute maximum)
    wordcountmax	(the maximum number of words the posted article should have: 100 is the absolute minimum, 1000 is the absolute maximum)
    frequency		(an integer value representing the number of seconds in between posts -- minimum is 28800, or about three posts per day. Note that the posting time will not be exact, as it is adjusted automatically to cause posts to be more random in appearance)
    genericresource	OPTIONAL (0 = no generic resource box [default], 1 = use generic resource box)
    genericlinks	OPTIONAL (required if genericresource is 1 -- see auto-posting details page for full description of this option)
    addimages		OPTIONAL (0 = don't add an image to the post [default], 1 = add an image to the post)
    addyoutube		OPTIONAL (0 = don't add a youtube video to the post [default], 1 = add an youtube video to the post)
    resource		OPTIONAL (resource box, nested spinning supported)
    comments		OPTIONAL (0 = don't allow comments on the post [default], 1 = allow comments on the post)
    pingbacks		OPTIONAL (0 = don't allow pingbacks on the post [default], 1 = allow pingbacks on the post)
    draft			OPTIONAL (0 = immediately publish the post [default], 1 = post as a draft)
    
  12. deleteUniquePostJob

    从用户的账户中删除唯一内容自动发布作业。

    function: unqiuePostJob($dataArray)

    require: dataArray 包含以下键和值

    [Key]			[Value]
    action			deleteUniquePostJob
    id				(the unique content posting job id)
    
  13. doUniqueAutoPost

    按需运行指定的唯一内容自动发布任务,该任务将内容发布到配置的博客。如果成功,则返回XMLRPC返回的发布url。请注意,必须有从iNeedArticles.com完成的文章可用,否则调用将失败。

    function: unqiuePostJob($dataArray)

    require: dataArray 包含以下键和值

    [Key]			[Value]
    action			doUniqueAutoPost
    id				(the unique content posting job id to run)
    
  14. 分类

    函数: categories()

    Returns:
    	[Key]		[Value]
    	success		true
    	output		(the category list--PHP array or XML table)
    
  15. apiQueries

    函数: apiQueries()

    Returns:
    	[Key]			[Value]
    	success			true
    	apiQueries		(the number of queries that have been performed today)
    	maxApiQueries	(the number of queries that the authenticated user can make to the API per day)
    
  16. apiTipQueries

    函数: apiTipQueries()

    Returns:
    	[Key]				[Value]
    	success				true
    	apiTipQueries		(the number of getTip queries that have been performed today)
    	maxApiTipQueries	(the number of getTip queries that the authenticated user can make to the API per day)
    

XMLRPClientWordpress 服务函数

  1. 创建帖子

    函数: createPost($title, $body, $category, $keywords, $encoding)

    require:

    $title 		title of the article
    $body 		body of the article
    $category 	categories (array) of the article (optional) 
    $keywords 	keyword of the article (optional)
    $encoding 	by default its UTF-8 encoding (optional)
    
    Returns:
    	blogid
    
  2. 获取帖子

    函数: getPost($blogId)

    require:

    $blogId 	blog id of the specific blog
    
    Returns:
    	blog details (containing permalink, etc.)
    
    
  3. 显示作者

    函数: displayAuthors($blogId)

    require:

    $blogId 	(optional) blog id
    
    Returns:
    	blog authors detail