网站调用新浪微博内容(=你的分享标题pics(图)=(组图) )

优采云 发布时间: 2021-11-25 11:15

  网站调用新浪微博内容(=你的分享标题pics(图)=(组图)

)

  一、qq空间

  &title=富格式重传时的默认文本内容或消息正文的标题,富格式最多15个全角字符

  &url=中继页面的url

  &pics=需要重播的图片的url,多张图片用|

  &summary=分享描述信息

  &site=分享源如:腾讯(可选)

  &desc=默认共享原因(可选)

  &a*敏*感*词*ey=填写正确的a*敏*感*词*ey,重播后会显示key的来源

  &line1=邮件正文第一行的文本,长度最多为 15 个全角字符

  &line2=邮件正文第二行的文本,长度最多为 15 个全角字符

  &line3=邮件正文第三行的文字,最长15个全角字符

  1.分享到QQ空间界面:你的网址&sharesource=qzone&title=你的分享标题&pics=你的分享图片&summary=你的分享描述信息

  2.分享到QQ好友界面:你的分享网址&sharesource=qzone&title=你的分享标题&pics=你的分享图片地址&summary=你的分享描述&desc=你的分享简介

  二、新浪微博

  count=表示是否显示当前页面的共享页数(1显示)(可选,允许为空)

  &url= 将页面地址转换为短域名并显示在内容文本后面。 (可选,允许为空)

  &a*敏*感*词*ey=显示用于发布微博的来源。如果为空,则显示来自互联网的共享内容来源。 (可选,允许为空)

  &title=分享时显示的文字内容,如果为空,会自动抓取分享页面的标题值(可选,允许为空)

  &pic=自定义图片地址,为微博图片(可选,允许为空)

  &ralateUid=转发时会@相关微博账号(可选,允许为空)

  &language=语言设置(zh_cn|zh_tw)(可选)

  1.分享到新浪微博界面:你的分享地址&sharesource=weibo&title=你的分享标题&pic=你的分享图片&a*敏*感*词*ey=你的key

  三、豆瓣

  image=分享图片

  &url=分享网址

  &name=分享标题

  &text=分享内容

  1.分享豆瓣:你的分享网址&名称=分享标题&文字=分享内容

  四、生成二维码扫描分享到微信

  您的分享网址

  五、优酷

  五、代码

   分享到:

   function shareTo(types) {

var title, imageUrl, url, description, keywords;

//获取文章标题

title = document.title;

//获取网页中内容的第一张图片地址作为分享图

imageUrl = document.images[0].src;

// imageUrl = document.getElementById("pcdetails").getElementsByTagName("img")[0];

//当内容中没有图片时,设置分享图片为网站logo

if (typeof imageUrl == 'undefined') {

imageUrl = 'https://' + window.location.host + '/static/images/logo.png';

} else {

imageUrl = imageUrl.src;

}

//获取当前网页url 这个地方根据你的页面来

// url = document.location.href;

url = 'feisu.com';

//获取网页描述

description = document.querySelector('meta[name="description"]').getAttribute('content');

//获取网页关键字

keywords = document.querySelector('meta[name="keywords"]').getAttribute('content');

//qq空间接口的传参

if (types == 'qzone') {

window.open('https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + url + '&sharesource=qzone&title=' + title + '&pics=' + imageUrl + '&summary=' + description, '', 'width=800,height=650,top=100,left=15');

}

//新浪微博接口的传参

if (types == 'sina') {

window.open('http://service.weibo.com/share/share.php?url=' + url + '&sharesource=weibo&title=' + title + '&pic=' + imageUrl + '&a*敏*感*词*ey=2706825840', '', 'width=800,height=650,top=100,left=15,toolbar=no, menubar=no, scrollbars=no, resizable=no');

}

//qq好友接口的传参

if (types == 'qq') {

window.open('http://connect.qq.com/widget/shareqq/index.html?url=' + url + '&sharesource=qzone&title=' + title + '&pics=' + imageUrl + '&summary=' + description + '&desc=' + keywords, '', 'width=800,height=650,top=100,left=15,toolbar=no, menubar=no, scrollbars=no, resizable=no');

}

//生成二维码给微信扫描分享

if (types == 'wechat') {

//在线二维码生成只支持小批量调用,过多访问会限制403.

// https://zixuephp.net/inc/qrcode_img.php接口参数:url:二维码内容,size:二维码图片大小值1-10

window.open('https://zixuephp.net/inc/qrcode_img.php?url=' + url, '', 'width=800,height=650,top=100,left=15,toolbar=no, menubar=no, scrollbars=no, resizable=no');

}

// 豆瓣网

if (types == 'tudou') {

//在线二维码生成只支持小批量调用,过多访问会限制403.

// https://zixuephp.net/inc/qrcode_img.php接口参数:url:二维码内容,size:二维码图片大小值1-10

window.open('https://www.douban.com/share/service?url=' + url, '', 'width=800,height=650,top=100,left=15,toolbar=no, menubar=no, scrollbars=no, resizable=no');

}

}

0 个评论

要回复文章请先登录注册


官方客服QQ群

微信人工客服

QQ人工客服


线