php写微博
❶ follow5的运行流程
follow5的运行流程如下:
1、打开网络,输入follow5,即可看到官网地址,点击进入。
2、如果没有账号可以自己注册个,有的话点击登录就行了。
3、登录完成后点击微频道。
4、在微频道里,根据自己的喜好,同步自己所需的微博。
5、以新浪微博为例,通过验证,即可实现同步的效果。
6、同样,可以通过上面的方法,只需通过佛fllow5发布信息即可同步到所有的微博上。
新版Follow5概述
经过Follow5团队的长时间筹划,2011年8月23日,Follow5新版正式上线。 新版Follow5界面简洁大方,功能上重点突出,用户体验上也有了很大的提高。
新版Follow5改版的原则是“去微博化,简化、方便大家在多微博环境下的玩法”。部分功能譬如发言字数改为更通行的140字,个性化皮肤会尽快得到支持,手机及桌面客户端会在下一版中得到更新。
新版Follow5的新功能主要体现在以下几点:
1、 支持双向同步 - 用时间轴的方式查看各微博内容。
2、 提升用户体验 - 全新设计、全新改版、全新体验# 支持计划任务 - 计划任务、定制需求、智能操作。
以上内容参考 网络-follow5
这个功能,你可以参考微博的推送思路。
比如你关注了很多明星(千万级大V),他们发的每条微博会进入到“我的首页”。比如某个明星发了条微博abc,你在“我的首页”里看到的"abc"并不是读自明星微博个人的数据库,而是来自“我的首页”里一个专门的数据集合。
通俗的讲,这个数据集合是完全属于你个人的,你所关注的每个人,当他们发微博时,会同步“推送”到你自己个人的这个“数据集合”里。
那么问题来了,千万级大V,每发一条微博,就要同步推给千万个粉丝,生成千万条数据吗?NO,微博根据用户活跃度等一系列算法,将用户分成不同梯队,一批一批的推送,例如一个近30天都没登录过的用户,自然就会被划到较迟推送的那一批里。这样做是为了分流服务器负担。
但不同产品对于数据设计有不同的思路,你这个公用一条站内信,我的建议是,建个公共站内信统一变量(例如letter=20160514),可以保存到用户的cookies里。
当用户访问页面时,程序首先将这个变量值和cookies里保存的变量对比,相同则略过,不同则进行读取相应的公共站内信,保存到自己的“收件箱”里。
这样可以使原本需要同步推给千万用户一条站内信的工作,由主动推送变成被动发送。用户上线访问了,对比、发送,这种工作显然要大大减小了服务器压力。
读取消息也是,反馈生成一条数据写到数据库里就好了。
❸ php能不能实现定时发送微博功能大概都用到哪些知识点
不能,web服务器代码一般都是由用户访问才会运行的,没人访问它什么的不会做。除非你让php用一个死循环一直运行。
❹ 新浪微博 api 网站中判断登录是依据uid还是token呢 php的
判断用uid,每次登陆成功都将access_token写入数据库。
那个access_token是和用户对应用授权有关的。
❺ php网站有哪些
PHP网站有很多,以下是部分知名的PHP网站:
一、知乎
知乎是一个中文问答社区,很多功能和页面都是基于PHP开发的。它是知识分享和交流的热门平台,用户可以提问、回答、分享经验等。
二、腾讯企鹅智库
腾讯企鹅智库是腾讯公司旗下的一个数据研究平台,该平台大量使用PHP技术提供服务。企鹅智库提供了一系列关于互联网趋势的研究报告。
三、美团网
美团网是一个在线订餐和生活服务平台,其网站也是基于PHP开发的。用户可以在这里订购餐饮、电影、酒店等,享受便捷的生活服务。
四、微博
微博是一个流行的社交网络微博客平台,其网站也是使用PHP作为主要开发语言之一。用户可以在这里发布消息、分享动态、互动交流等。
五、京东商城
京东商城是中国最大的电子商务网站之一,提供了丰富的商品和服务。它的网站架构也是基于PHP的,尤其是后台管理系统等核心部分。由于电商网站对数据处理和交互要求极高,PHP的动态性和灵活性为京东提供了强大的技术支持。此外,还有大批的政府网站和企业网站也在使用PHP作为主要的开发语言。如需更多PHP网站信息,可查询站长之家网站公布的排名榜单获取相应信息。不同领域的PHP网站可能具备不同的功能需求和用户体验设计,具体使用情况也不同。
❻ 如何获取新浪微博的登录参数
1、用Chrome的开发者工具或者Firefox的Firebug来进行抓包
找到login.php文件,就可以看到此文件的一些请求参数,
Request URL:
http://login.sina.com.cn/sso/login.php?client=ssologin.js(v1.3.22)
Request Method:
POST
Status Code:
200 OK
Request Headersview source
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:
GBK,utf-8;q=0.7,*;q=0.3
Accept-Encoding:
gzip,deflate,sdch
Accept-Language:
zh-CN,zh;q=0.8
Cache-Control:
max-age=0
Connection:
keep-alive
Content-Length:
380
Content-Type:
application/x-www-form-urlencoded
Cookie:
Apache=00000073.8a4c255d.4fbcca08.3dec6e4b; SINAGLOBAL=00000073.8a51255d.4fbcca08.f60eaf69; U_TRS1=00000073.a032426f.4fbccf5b.de1e4686; U_TRS2=00000073.a044426f.4fbccf5b.84a48193; UOR=,www.sina.com.cn,; ULV=1337773919392:1:1:1:00000073.8a4c255d.4fbcca08.3dec6e4b:; SGUP=0; _s_upa=2; vjuids=1c9c46cf8.137798a2e07.0.baab928e; vjlast=1337773928; __utma=269849203.1663258918.1337773929.1337773929.1337773929.1; __utmb=269849203.1.10.1337773929; __utmc=269849203; __utmz=269849203.1337773929.1.1.utmcsr=login.sina.com.cn|utmccn=(referral)|utmcmd=referral|utmcct=/crossdomain2.php; ULOGIN_IMG=
Host:
login.sina.com.cn
Origin:
http://weibo.com
Referer:
http://weibo.com/
User-Agent:
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19
Query String Parametersview decoded
client:
ssologin.js(v1.3.22)
Form Dataview decoded
entry:
weibo
gateway:
1
from:
savestate:
0
useticket:
1
vsnf:
1
ssosimplelogin:
1
su:
bmlfd2Vpd2VpJTQwMTYzLmNvbQ%3D%3D
service:
miniblog
servertime:
1337774007
nonce:
WSFYJG
pwencode:
wsse
sp:
encoding:
UTF-8
prelt:
980
url:
http%3A%2F%2Fweibo.com%2Fajaxlogin.php%3Fframelogin%3D1%26callback%3Dparent.sinaSSOController.feedBackUrlCallBack
returntype:
META
Response Headersview source
Cache-Control:
no-cache
Connection:
close
Content-Encoding:
gzip
Content-Length:
414
Content-Type:
text/html
Date:
Wed, 23 May 2012 11:53:30 GMT
P3P:
CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"
Pragma:
no-cache
Server:
Apache
Set-Cookie:
SUE=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.sina.com.cn, SUP=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.sina.com.cn, ALF=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.sina.com.cn, ALC=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=login.sina.com.cn, SUR=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.sina.com.cn, SSOLoginState=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.sina.com.cn
Vary:
Accept-Encoding
via_host:
38.62
2、用httpclient4.x登录新浪微博源码(转)
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
public class SinaLogin {
private final static HttpClient client = new DefaultHttpClient();
/**
* 抓取网页
*
* @param url
* @throws IOException
*/
static String get(String url) throws IOException {
HttpGet get = new HttpGet(url);
HttpResponse response = client.execute(get);
System.out.println(response.getStatusLine());
HttpEntity entity = response.getEntity();
String result = mp(entity);
get.abort();
return result;
}
/**
* 执行登录过程
*
* @param user
* @param pwd
* @param debug
* @throws IOException
*/
static void login(String user, String pwd) throws IOException {
HttpPost post = new HttpPost(
"http://login.sina.com.cn/sso/login.php?client=ssologin.js(v1.3.14)");
post.setHeader("User-Agent",
"Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0");
post.setHeader("Referer", "http://weibo.com/");
post.setHeader("Content-Type", "application/x-www-form-urlencoded");
// 登录表单的信息
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("entry", "miniblog"));
qparams.add(new BasicNameValuePair("gateway", "1"));
qparams.add(new BasicNameValuePair("from", ""));
qparams.add(new BasicNameValuePair("savestate", "0"));
qparams.add(new BasicNameValuePair("useticket", "1"));
qparams.add(new BasicNameValuePair("ssosimplelogin", "1"));
qparams.add(new BasicNameValuePair("service", "miniblog"));
// servertime=1309164392
// nonce=PJZCHM
// qparams.add(new BasicNameValuePair("pwencode", "wsse"));
qparams.add(new BasicNameValuePair("encoding", "utf-8"));
qparams.add(new BasicNameValuePair(
"url",
"http://weibo.com/ajaxlogin.php?framelogin=1&callback=parent.sinaSSOController.feedBackUrlCallBack"));
qparams.add(new BasicNameValuePair("returntype", "META"));
qparams.add(new BasicNameValuePair("username", user));
qparams.add(new BasicNameValuePair("password", pwd));
UrlEncodedFormEntity params = new UrlEncodedFormEntity(qparams, "UTF-8");
post.setEntity(params);
// Execute the request
HttpResponse response = client.execute(post);
post.abort();
// 新浪微博登录没有301,302之类的跳转;而是返回200,然后用javascript实现的跳转
// int statusCode = response.getStatusLine().getStatusCode();
// if ((statusCode == HttpStatus.SC_MOVED_PERMANENTLY)
// || (statusCode == HttpStatus.SC_MOVED_TEMPORARILY)
// || (statusCode == HttpStatus.SC_SEE_OTHER)
// || (statusCode == HttpStatus.SC_TEMPORARY_REDIRECT)) {
// // 此处重定向处理 此处还未验证
// String newUri = response.getLastHeader("Location").getValue();
// get(newUri);
// }
// Get hold of the response entity
HttpEntity entity = response.getEntity();
// 取出跳转的url
// location.replace("http://weibo.com/ajaxlogin.php?framelogin=1&callback=parent.sinaSSOController.feedBackUrlCallBack&ticket=ST-MTkxODMxOTI0Nw==-1309224549-xd-&retcode=0");
String location = getRedirectLocation(mp(entity));
get(location);
}
private static String getRedirectLocation(String content) {
String regex = "location\\.replace\\(\'(.*?)\'\\)";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(content);
String location = null;
if (matcher.find()) {
location = matcher.group(1);
}
return location;
}
/**
* 打印页面
*
* @param entity
* @throws IOException
*/
private static String mp(HttpEntity entity) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(
entity.getContent(), "utf8"));
//return EntityUtils.toString(entity);
return IOUtils.toString(br);
}
public static void main(String[] args) throws IOException {
login("username", "password");
String result = get("http://t.sina.com.cn/pub/tags");
System.out.println(result);
}
}
❼ qq第三方授权登录(PHP),发表腾讯微博,参数怎么传!!!!
你好,第三方登录需要你是企业类的的,要去申请,然后得到一些接口数据然后使用其平台提供给的sdk进行相关设置就可以了