Intense Debate PHP Class? - php

I'm working with Intense Debate. I keep looking for a way to integrate a non-javascript version in my websites… and I was hoping there would be some sort of PHP Class available but I can not find one on google, and the API they provide is a Javascript API for customization.
What I want to do is use Intensedebate like wordpress does but in my own script. They said this in their FAQ on SEO:
IntenseDebate outputs the standard WordPress comments enabling your comments to still be indexed by search engines that ignore JavaScript, while ensuring that visitors surfing with JavaScript disabled will be able to interact with comments made in IntenseDebate. Readers with JS disabled can comment in the original WP system and those comments will be imported into ID.
That is actually what I am trying to achieve with my own custom PHP script. But there is no documentation on this…
You can see what I mean on my temporary test page: http://repost.be/index.php
As you can see when you disable javascript… you can't see the comments, nor comment.
That is by the way just an HTML page with custom Javascript that Intensedebate provided.
Any thoughts on how I can interact with their API properly or find a PHP class that does so?

I'm not familiar with IntenseDebate, but from what I can gather from their help docs and general comments on the net, their system absolutely requires Javascript to run. There's no way to use their data through another API.
Apparently IntenseDebate gives WP users the option to sync their comments with IntenseDebate through the provided Wordpress plugin. Maybe you

Related

I am building a small web application and i want to use JSON API to bring in Wordpress posts into my web app

So I am building a small web app. I have set it all up on Ubuntu and I am using Wordpress. I want to use a plug-in called JSON API to pull in content from my Wordpress blog in an easy to read form and I want this to be updated to say have only 5 posts at a time being the 5 most recent ones. I’ve looked around and I was wondering if someone could help me and give me an idea on how to go about this? I am a complete beginner I have no previous experience I have not started typing any codes or anything like that because I'm not sure how to start it.
You have a few options here, and which one you choose really depends on what works for you.
WordPress has a built-in API, but this is not a JSON API, it's XML-RPC. It's pretty feature-rich and won't require you to write any code (on the WP side) to pull posts. More info here: http://codex.wordpress.org/XML-RPC_Support
Read directly from the database. This is probably a faster implementation if you're reading from the same box. Simply connect to the database WordPress uses and query the posts table directly.
Find a JSON API plugin that suits your needs. It's difficult to recommend any as you seem to have specific requirements. Try some, and see what works for you. The downside to this is you'll need to keep the plugin up-to-date, and you're using third-party code - I'll leave it up to you whether you believe that to be a bad thing or not.
Write your own! It should be relatively straightforward to write a small script to pull in posts from the WordPress database and spit out a well-formed JSON feed.

Get Twitter feed based on multiple hashtags

I am trying to build a web application that would display Twitter feed based on multiple hashtags in real time. Something like TweeterWall. I've been Googling around, but there are so many APIs that I am a bit confused.
My setup is a standard shared hosting with PHP and MySQL.
My question: Which method is best suited for my environment?
Should I use Streaming API, Search API, Sockets, maybe Javascript with setInterval()..
i realy ont know..
Thanks for your answers.
- Cheers
Take a look at this project on GitHub. Don't be confused by the title - it has been updated since Twitter's API update to 1.1.
The jQuery plugin on the page has been re-purposed to be a Rendering engine, i.e. it helps with rendering your feeds.
The important part, however is in the "Server-Side Examples and Setup" directory. Go there, read the SETUP_INSTRUCTIONS document, and use the code in the "Plug_and_Play/Ready_PHP.php" file as your starting point.
If you followed the instructions in the SETUP_INSTRUCTIONS document, you should only have to copy and paste the keys from Twitter into the file, along with a Twitter handle, and it should render the timeline for you.
Note that you will have to update the code to render multiple timelines, and will have to either use AJAX or some other solution for updating the timelines, to simulate real-time.
On that note, be careful not to blow the rate-cap. If you are rendering timelines for just two Twitter handles, you can update them only once every 6 seconds (best case scenario). To do this, you will have to use a separate web service to perform the requests and then query that service from your webpage.
P.S. I am the author of that project, so if you need any help, let me know. Good luck! :)

How to create a widget in php & javascript?

I have a website for a client offering information from a database. But other websites want to show that information in their website, so my client ask me for it.
Since the begining I thought it might be something similar to the twitter widget. As I want to give out a code similar to this:
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({ ......
And other websites will show the information from my database.
But I cannot find a exactly example, I found this: http://tutorialzine.com/2010/03/who-is-online-widget-php-mysql-jquery/
But it is not exactly what I want.
My deployment is the following: In the server I've got a mySQL database and a website, I would like to create php and javascript code (or even jquery, but I'm not very expert with it) so other website could incorporate the information from the database in a secure mode.
Could anybody give a hint?
You'll need a RESTful service on your server which other sites can ping. You will use an AJAX request to get the information from that service.
The big piece of this for you will be creating a JavaScript object that has all the functionality you want. It is much easier to give people directions on how to use your REST API and let them implement it via AJAX on their own pages. If you really do want a full widget, you'll want to check out a lot of things. First is closures in JS to ensure you don't conflict with any of their variables. Also make sure you are good at developing cross-browser Javascript independent of libraries. And finally, you'll want to make sure your server is configured for cross-domain AJAX requests. Again, my recommendation is to set up a REST API for them, and let them do the dirty work.
There is an interesting tutorial about how to create a twitter widget using PHP and JavaScript on the nettuts website, I think you may find it useful.
Well, although it's not specific for PHP, this is by far the best resource I could find to this subject:
http://alexmarandon.com/articles/web_widget_jquery/

Existing PHP Tool for Feature Toggle

Recently I've read a number of articles talking about the idea of using "feature toggles" or "gatekeepers" to keep features hidden from users until the development is done. Facebook and Flickr both also talk about how they use this to test new features with a subset of users before unleashing them on everyone.
A bit of googling didn't turn up any existing PHP packages/tools that can be added to a web app to handle this type of thing. It seems straight forward enough to roll our own but no reason to re-invent that wheel if we don't need to. Are there any existing PHP tools to do this?
Articles
Feature Toggle by Martin Fowler
Flipping Out on Flickr DevBlog
Clarification: The part of this that I'm looking to see if it exists is the admin panel that controls which users can see the new features. In Flickr's example, they can turn it on based on the host. In the Facebook example, they add functionality such as limiting a feature to 5% of users, only TechCrunch users or only East coast users.
The admin panel seems crucial when you have 200 turned on features, 10 features that aren't quite done yet and 3 more that you're demoing for some users.
if (user_can_see_app()) {
show_app();
} else {
dont_show_app();
}
I fail to see why a package would be required for something so simple.
I've wrote a micro service for feature toggle pattern, called Bipolar:
https://marinho.github.io/bipolar-server
It is written in Python but that doesn't matter because it is an external API and Admin interface, so, all you need is to write a PHP client for it. We have used it in production for a while but only worked on public release and documentation recently. For JavaScript support it can push notifications using Webhooks as a basic URL call or via Pusher event.
I am bit missed after many years with no contact with PHP, but I can help you to write the client if you are interested.
I hope that can be helpful.
The easiest solution i found is to have the feature toggle state stored in some remote location that can change easily (turn it on/off)
I found it easy to have on GitHub a repo holding some JSON data with the feature toggle's state, later on you can change that state on GitHub (from phone/pc etc...)
your php code needs to fetch the JSON and make a decision from it ...
you can look at the blog post about how to achieve this:
http://www.nimrodstech.com/dead-simple-feature-toggle/
it shows a code snippet of how to achieve this in a simple way.

Looking for a easy integration PHP forum

I'm building a website with codeigniter (PHP) and I'm looking for a forum easy to integrate with my current database so users don't have to register twice. Moreover, I need to use the same html head and styles that in my website, placing the forum inside a div of <body>
Could anyone recommend me any simple forum application for my situation? Thanks.
I'm not aware of CI-specific solutions, but I've used a couple times MyBB and I can say it's really easy to integrate anywhere, as (at least in the 1.6 release, I haven't use it for some time) it's structure is easily moddable. I integrated it in a Joomla! website and in a custom one, and in both ways it's just a matter of reading the mybb_users table for access; it's quite a detailed table, so you can find almost anything you need for a registration table, like salt,password,timestamp of registration,email, and so on, so you just need to query that table and you're set.
As for the integration with CI I think the best way would be to place the whole forum folder and access it there; for the header, footer and other website parts you just change the relative forum template (layout are divided into subsets of templates, so you can change it easily and in details) and the user would not notice they are different applications.
You can also try and build a CI library for communicatin with the forum; they don't have an official API, but in functions.php and a couple other files I don't remember now (yes, 1.6 was mostly procedural, hope they have changed it now) you'll find all the relevant MyBB core, so building an API is straightforward; I once built own for Joomla! and was really easy. Moreover, there's This guy who wrote an integration for MyBB which is, in fact, a nice API; I don't know how updated it is, just check, but It's not difficult to port those files to a Codeigniter custom library, in case.
For database integration you're not going to find a forum that uses the same DB architecture as CodeIgnitor. What you can do, however, is alter your PHP registration scripts (for both CodeIgnitor and your forum) to add an entry in both member records.
Depending on your database you can also use Database Triggers to automatically update the other table when one is updated.
As for your layout, anything can be modified. Open source options will be the simplest, so I'd recommend phpBB for simplicity sake.
For more information on Database Triggers in MySQL, see here: http://dev.mysql.com/doc/refman/5.0/en/triggers.html
I would suggest using PHPBB forum or Wordpress with the BuddyPress plug-in.
I'm not quite sure how the integration with your codeigniter would be, but seeing as PHP is open-source, it shouldn't be too hard to crack open and find out.

Categories