问题描述
楼主我是新来的这家公司。做的是新闻这一块。因为刚到没多久。现在的情况是,百度无法收录我们公司新闻编辑发布的稿子。目前我们公司每天是发200篇新闻稿的样子。如图:烦请各位大神帮忙解答解答。是什么导致的呢。楼主QQ:80475542实在没分了。哪位大哥帮忙处理一下。之前开发编写的代码如下:#region实时推送到百度//////实时推送到百度//////相对URL地址///发布时间格式:yyyy-MM-ddpublicstaticvoidSendSiteBaiDu(Listlist){StringBuildersb=newStringBuilder();stringsHost=string.Format("http://{0}/",HttpContext.Current.Request.Url.Host);stringsStr=string.Empty;BLL.Area_Provincebllap=newBLL.Area_Province();Model.Area_Provincemodelap;//sb.Append("POST/sitemap?site=xiaofei.china.com.cn&resource_name=sitemap&access_token=6kSXoZC7HTTP/1.1rn");//sb.Append("User-Agent:curl/7.12.1rn");//sb.Append("Host:ping.baidu.comrn");//sb.Append("Content-Length:9666rn");sb.Append("<?xmlversion="1.0"encoding="UTF-8"?>rn");sb.Append("rn");foreach(Model.News_Issueminlist){modelap=bllap.GetModel(m.ProvinceId);sStr=m.ProvinceId==9?sHost:sHost+modelap.JianPin+"/";sStr=m.NewsUrl.Split(':').Length>1?m.NewsUrl:sStr+m.NewsUrl;sb.Append("rn");sb.Append("<![CDATA[");sb.Append(sStr);sb.Append("]]>rn");sb.Append("");sb.Append(m.IssueTime);sb.Append("rn");sb.Append("alwaysrn");sb.Append("0.8rn");sb.Append("rn");}sb.Append("rn");stringpostUrl="http://ping.baidu.com/sitemap?site=xiaofei.china.com.cn&resource_name=sitemap&access_token=WLDkBcFq0zlJr4QF";HttpXmlPostRequest(postUrl,sb.ToString(),Encoding.UTF8);}//////实时推送到百度//////相对URL地址///发布时间格式:yyyy-MM-ddpublicstaticvoidSendSiteBaiDu(stringsNewsUrl,stringsIssueTime,short?ProvinceId){StringBuildersb=newStringBuilder();stringsHost=string.Format("http://{0}/",HttpContext.Current.Request.Url.Host);stringsStr=string.Empty;BLL.Area_Provincebllap=newBLL.Area_Province();Model.Area_Provincemodelap=bllap.GetModel(ProvinceId);sStr=ProvinceId==9?sHost:sHost+modelap.JianPin+"/";sStr=sNewsUrl.Split(':').Length>1?sNewsUrl:sStr+sNewsUrl;//sb.Append("POST/sitemap?site=xiaofei.china.com.cn&resource_name=sitemap&access_token=6kSXoZC7HTTP/1.1rn");//sb.Append("User-Agent:curl/7.12.1rn");//sb.Append("Host:ping.baidu.comrn");//sb.Append("Content-Length:9666rn");sb.Append("<?xmlversion="1.0"encoding="UTF-8"?>rn");sb.Append("rn");sb.Append("rn");sb.Append("<![CDATA[");sb.Append(sStr);sb.Append("]]>rn");sb.Append("");sb.Append(sIssueTime);sb.Append("rn");sb.Append("alwaysrn");sb.Append("0.8rn");sb.Append("rn");sb.Append("rn");stringpostUrl="http://ping.baidu.com/sitemap?site=xiaofei.china.com.cn&resource_name=sitemap&access_token=WLDkBcFq0zlJr4QF";HttpXmlPostRequest(postUrl,sb.ToString(),Encoding.UTF8);}///<summary>///HttpPost发送XML并返回响应///</summary>///<paramname="postUrl"></param>///<paramname="xml"></param>///<paramname="encoding"></param>///<returns>Response响应</returns>publicstaticvoidHttpXmlPostRequest(stringpostUrl,stringpostXml,Encodingencoding){if(string.IsNullOrEmpty(postUrl)){thrownewArgumentNullException("HttpXmlPostArgumentNullException:postUrlIsNullOrEmpty");}if(string.IsNullOrEmpty(postXml)){thrownewArgumentNullException("HttpXmlPostArgumentNullException:postXmlIsNullOrEmpty");}varrequest=(HttpWebRequest)WebRequest.Create(postUrl);byte[]byteArray=encoding.GetBytes(postXml);request.ContentLength=byteArray.Length;request.Method="POST";request.ContentType="text/xml";using(varrequestStream=request.GetRequestStream()){requestStream.Write(byteArray,0,byteArray.Length);}//using(varresponseStream=request.GetResponse().GetResponseStream())//{//returnnewStreamReader(responseStream,encoding).ReadToEnd();//}//returnretString;}#endregion}
解决方案
解决方案二:
百度收录是需要一个周期的吧,如果一直没收录,那要考虑是不是被封了
解决方案三:
直接问baidu