PHP uses cron to cash on articles and synchronize them to Sina, Netease, and other Weibo posts.

Source: Internet
Author: User
Tags php website cpanel wordpress blog
PHP uses cron to synchronize articles to Sina and Netease Weibo 1. Tw2other? Is a PHP applet that supports synchronizing data from twitter to digusinazu?follow59911 Douban broadcast fresh fruit broadcast to the Internet, and NetEase Weibo? Author: cluries author homepage: cuies. comTw2other: code PHP uses cron to synchronize articles to Sina, Netease, and other Weibo posts

1. Tw2other

?

A php applet that supports twitter synchronization to digu/sina/zuosa/follow5/9911/Douban broadcast/fresh fruit broadcast/human/Renren/NetEase Weibo

?

Author: cluries
Author home: http://cuies.com

Tw2other: http://code.google.com/p/tw2ohter? Or download from the attachment (the latest version is not guaranteed)

?

The settings are as follows:

?

1) config. php file settings

Use editplus, UltraEdit, notepad ++ and other text editing software to open and modify the settings:

?

Row 3:

define ( ‘INTERVAL’, 50 );
?

Here, 50 is the update interval. if free space is used, it is recommended to modify it because it will put a lot of pressure on the space if the time is short, space providers will also easily block your space.

?

Row 3:

$twitterApi = ‘http://twitter.com/’;
?

This is the twitter address. if your Tw2other server is in China and cannot access twitter, modify the value here for your own twitter api address. of course, if the host is abroad, you do not need to modify it.

?

Row 3:

$twitterUser = ‘cluries’;
?

This is the user name of the cluries author on twitter. replace it with your own.

?

19th rows

$twitterSyncLevel = 0;
?

This parameter can be left unchanged. if you really need to modify this parameter, enter the parameter according to the instructions. Finally, modify the username and password of the Weibo account you want to synchronize.

?

2) cron. php file settings

?

8th rows

$url = ""

? ? Enter the address of the uploaded space. for example, if you upload the project file to the/public_html/tw2other/folder of the space, the tw2other php program is set up now.

?

3) space Cron settings

?

After the above file settings are complete, upload all the files to the/public_html/tw2other/folder in the space. you can name the tw2other folder here, but you should use this name for clarity, note: If you change to another folder name, remember to modify cron. php website!

?

Modify the directory where tw2other is located and the cookie folder under the Directory has the write permission. Otherwise, the synchronization may be repeated based on the information, leading to screen flushing! That is, the cookies folder under the tw2other folder and the tw2other folder are modified to 777 using the ftp tool.

Log on to the background of your C-panel space and select cron jobs

?

?

After entering, select standard level.

?

?

Here is the interface for setting Cron job

?

?

The upper part of the interface is the mailbox. you can set a mailbox. each time a cron job runs, it will send an email to your mailbox. we recommend that you choose the mailbox when setting it, in this way, you can check whether the cron job runs correctly. if it runs correctly, you can delete the mailbox. Otherwise, if the cron job you set has a short interval, those spam will bother you. The method to disable it in the future is also very simple, that is, leave the mailbox to be deleted blank, and then save it.

The following command line is the run command you want to enter. it starts with the position of the php interpreter. if cPanel is used, it is generally located in/usr/local/bin/php, enter the cron you uploaded. php location.

The command is as follows:

?

?

/Usr/local/bin/php/home/your account name/public_html/tw2other/cron. php
?

?

The last step is to set the specific interval for running cron jobs. you can set it to run every minute or another interval. However, we recommend that you use free space, it is better to set a longer interval, for example, to run every five minutes, because the Cron of a free space I used was set to run every minute, resulting in excessive resource occupation on the server, as a result, the account is disabled.

?

Save the settings.

?

4) synchronization problems

?

After setting all the above steps, I tested it and found that the synchronization was not successful. I didn't make any operation errors either?

Log on to the Cpanel space background and view the error log.

?

?

Error message found:

[Fri Mar 26 10:58:02 2010] [error] [client 74.81.64.34] File does not exist:/home/qiankun/public_html/500.shtml
[Fri Mar 26 10:58:02 2010] [error] [client 74.81.64.34] SoftException in Application. cpp: 256: File "/home/qiankun/public_html/tw2other/index. php "is writeable by group

It turns out index. php is writable! When I think back to my operation process, I suddenly remembered that when I set the tw2other folder permission, I set the sub-files in the folder to 777 (read/write), which is easy to correct, set index. set php to 755.

?

?

Then test:

Publish a message on the twitter homepage:

?

?

Wait a moment to view Sina Weibo and NetEase Weibo

Sina meager: synchronization successful!

?

?

NetEase Weibo: sync successful!

?

?

Note: If synchronization is enabled to multiple Weibo posts, do not set synchronization between these Weibo posts. otherwise, information will be synchronized cyclically. When upgrading the version, directly overwrite it. do not delete the tweet. id file in the previous Directory (very important). Otherwise, it will lead to bad luck of repeated synchronization.

?

?

2. twitter2weibo

?

This script can only automatically synchronize Twitter updates to Sina Weibo.

?

Author: iamsure
Author home: http://iamsure.org

: Twitter2weibo. php

?

The file contains only one single file, twitter2weibo. php. open it with an editing tool and enter your Twitter username and password, Sina Weibo username and password;

?

?

Create a new weibo folder under the root directory public_html of the host and set the permission to 777;
Upload the file to the folder;


Create cron, set the time interval, and then set the running command (see the preceding section ):

?

/Usr/local/bin/php? /Home/your username/public_html/weibo/twitter2weibo. php

?

?

3. wordpress

?

Plug-in name: WordPress connects to Weibo

Plug-in author: shuimai Yanxiang

Author home: http://www.smyx.net/

Plug-in page: http://www.smyx.net/wp-connect.html

Plug-in description: Supports logging on to the WordPress blog using 16 partner website accounts, and supports synchronizing the title and link of the article to 14 Weibo blogs and communities.

Latest version: 2.1.3

Supported versions: V3.0 is the lowest and has been updated to WordPress 3.3.1.

: Http://wordpress.org/extend/plugins/wp-connect/

?

?

?

?

?

See:

Http://code.google.com/p/tw2ohter/

Cuies's blog

Cainiao notes? Use the PHP space cron to synchronize twitter to Sina and Netease Weibo | Qian Kun Blog

Http://www.fbair.net/bbs/read.php? Tid = 310

?

?

?

?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.