开发者

Create button like Digg button

开发者 https://www.devze.com 2023-01-17 00:04 出处:网络
I am building a news aggregator. How can I create button/ widget like Digg button or Facebook Share button that web developer can embed in their own website. When their users click on that button, it

I am building a news aggregator. How can I create button/ widget like Digg button or Facebook Share button that web developer can embed in their own website. When their users click on that button, it can trigger some function that interact (eg: voting or display vote amount) with my server. Thank开发者_开发问答 you.


Simple solution: You need PHP script that accepts GET parameters. The third party can send data payload in the GET parameter and your script can read them and do the needful.

Voting third party via button shouldn't be done via GET params. This will create bad voting attacks. What you can do is make an API for your third party systems and have them do a CURL request to your API with the POST data payload. Again, this isn't the most secure. To make it more secure, use the API key and domain / IP check.

If your system is based on user sessions, you can do a cookie check to determine USER Information and read values. (similar to facebook LIKE).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号