Can I use C++ to work on Twitter API? - c++

I am very excited to start working on Twitter API. I have looked about this on the web but I am unable to understand why most links talk about using PHP, Javascript or C# only.
Since I know C and C++ only, can I use these languages?
If not, then why?

Here are some C++ APIs for twitter:
kQOAuth by Johan Paul – a Qt based OAuth Library
libOAuth by Robin Gareus – a collection of POSIX-C functions implementing OAuth
QTweetLib by Toni Jovanoski – a Qt based Twitter API library
Twitcurl by Mahesh – a Twitter API library
(from https://dev.twitter.com/docs/twitter-libraries#cplusplus)
And you can always use the REST API from almost any language, which ist just a bunch of HTTP calls. You can do that for example with libcurl.

There are Twitter APIs for C++:
QTweetLib by Toni Jovanoski – a Qt based Twitter API library
Twitcurl by Mahesh – a Twitter API library
And you can always write your own. See also: https://dev.twitter.com/docs/twitter-libraries#cplusplus

Let's apply some logic. It can be done in PHP. PHP is written in C. Conclusion: yes it can be done in C. And anything that can be done in C can be done in C++.

If you're interested, there's a project over at Microsoft's DevLabs to provide a library that makes this task more straightforward. It looks pretty interesting, although it's still in development. http://msdn.microsoft.com/en-us/devlabs/casablanca.aspx

Related

How to make HTTP POST/GET in a c++ metro app?

I have a some web services that my app needs to communicate with by sending json with REST over HTTP POST/GET. The only way I can see to do this is with the iXMLHTTPRequest2 framework but geeze oh man is it uglier than I want to deal with.
Is this the only option I have to look at with c++?
Would this be easier with c#? I know most of the things are the same across the languages, but if c# has a better way to do this, I'd be willing to make the jump.
You should also look into Project Casablanca - it's a fully native C++ library that also is adapted for use with Metro apps (I believe it wraps IXHR2). I've been using it to perform http REST calls and to parse JSON very successfully.
That's the interface you have to use in C++. It is more difficult than in C#. Given that, there is a good sample that will make using that interface a bit more bearable.

What C++ libraries do Quora and Facebook use to access database?

I've read that Quora and Facebook use C++ in the backend. Both of them process and fetch big amounts of data. What libraries do they use for that? Did they develop them?
Facebook is known to have been written in php but now the php code is used to generate C++ code. To do that, they developped a converter tool named HipHop that you can use yourself (Open source AFAIK).
I don't know about quora.
Amazon.com does use C++ but it's, AFAIK, their own code, not a library.
If you're interested in C++ web applications, you should try CPPCMS.

Track C++ application with google analytics

Is a possibility to track my C++ application usage using google analytics?
to track application usage with google analytics is necessary to generate http request to this url:
*
http://www.google-analytics.com/__utm.gif?
utmwv=3&
utmn=<random number>&
utme=&
utmcs=ISO-8859-1&
utmsr=1280x1024&
utmsc=24-bit&
utmul=en-us&
utmje=1&
utmfl=-&
utmhn=<www.stopka.us>&
utmhid=2112093191&
utmr=-&
utmp=/login.php?user=12&
utmac=UA-XXXXX-1&
utmcc=__utma%3D1.<unique id>.<time (in sec's since Jan 1, 1970) of first
visit).<time of last visit>.<time of current visit>.<visit count>%3B
%2B
__utmz%3D1.1203103189.1.1.utmcsr%3D<source>%7Cutmccn%3D<campaign>
%7Cutmcmd%3D<medium>%3B
*
all parameters is possible to fill with it's user env. values.
This way is not convenient enough.
So, I create my own library. I call it UsageAnalytics and distribute it as open source project at: http://code.google.com/p/usageanalytics/
thanks for all for participation, thanks for me for the library.
btw. cause code.google.com outdated, I've moved that stuff to
https://github.com/vyemialyanchyk/usageanalytics
By now you may have already solved your need, but for what it's worth, my firm has also released a C library supporting Google's Universal Analytics Measurement Protocol.
https://github.com/analytics-pros/universal-analytics-c
Good luck!
Google has a library for accessing Analytics API from C++, it's in "alpha", but it looks like what you want... https://developers.google.com/api-client-library/cpp/apis/analytics/v2.4
The best library I found for tracking analytics with c++ is this unofficial one on github: https://github.com/HSAnet/qt-google-analytics
Note however that it has Qt as a dependency...
If you want to track C++ Android or iOS apps you could use Google's Firebase:
https://firebase.google.com/docs/analytics/cpp/start
Old question, but nowadays more and more developers are starting to use usage analytics for their software.
"SoftMeter", a library I created myself, is my solution to this need.
It has a native C and C++ interface.
https://www.starmessagesoftware.com/softmeter/sdk-api

Developing a facebook app with c++

I'm a computer science student with experience in C/C++ and I want to have a go at developing
a simple facebook app. Can anyone recommend a good website and/or editor?
Is it doable with C++ or do I need to learn another language?
Thanks
I assume that you are talking about an internet application.
For the front end (client side), you will need something to enhance your web pages (in Javascript, for example). For the back end (server side), you will need to make database queries so you will need to know SQL as well.
No, I don't think C/C++ is enough.
I would suggest that you investigate some other languages such as PHP or ASP.Net.
It sure is doable in C++. I recommend though that you first write a small Facebook client API in a scripting language so you can do some quick and dirty testing while getting familiar with how the API works. This will save you a lot of frustration when trying to write the C++ version.
As editor I recommend Visual C++ Express Edition if you are using Windows, XCode if you are using Mac, and on Linux I'd use Vim (if that is your cup of tea).
A good website? The Facebook API docs pages of course!
i Released c++ facebook graph api client as open source
check it out here :
facebook-cpp-graph-api
Python might be worth considering.
The Wiki might not be a bad place to start on it.
(There are a couple of link to Tutorials in there)
Facebook Developers Wiki
check this c++ graph api as open source you can download it and use it
its handling login/authentication sequence with the Qwebkit:
http://code.google.com/p/facebook-cpp-graph-api/

C++ web service framework

We are looking for a C++ Soap web services framework that support RPC, preferably open source.
Any recommendations?
WSO2 Web Services Framework for C++ (WSO2 WSF/C++), a binding of WSO2 WSF/C into C++ is a C++ extension for consuming Web Services in C++.
http://wso2.org/projects/wsf/cpp
Apache Axis is an open source, XML based Web service framework. It consists of a Java and a C++ implementation of the SOAP server, and various utilities and APIs for generating and deploying Web service applications.
http://ws.apache.org/axis/
http://code.google.com/p/staff/
Staff is Web Service Framework for C++ (service/component and client-side)/JavaScript(client-side) based on Apache Axis2/C.
Open-source, released with Apache License V2.0.
Try the ffead-cpp framework, it provides in-built web-service support, rest, json and many other useful features.
We are using EasySoap (http://easysoap.sourceforge.net/)
While not FOSS another library is ATL Server library from Microsoft.
It is C++ template based with some proprietary attributes by Microsoft. i.e. not standard C++
You can check out xmlbeansxx. This is a kind of lightweight, low level solution, compared to complete frameworks. This has advantages in some cases.
Invoking SOAP WebServices using xmlbeansxx Article
Code example is here:
WsClient.cpp.
You could try gSOAP. Available under GPL and commercial licences.
I have used SWIG to make an interface from C++ to Java or Python and then used the typical web interface support for those languages.
Since Java and Python have reflection the web services frameworks that exist for them have a much easier time passing data around.
Threading wise if your C++ code is thread safe you can let the Java server manage the creation of threads for concurrent requests etc. and just call into your C++ code using JNI.
As a bonus you can test your C++ code from Python using these same SWIG interfaces.
I think the way to go is to write your service in C++ (I am assuming you did all the homework and there is a good reason you want to write in C++) and then front it using an RPC server. Use something like Thrift or Protobufs for a fast RPC implementation.
Now write your web frontend in the language of your choice - python would be mine - and make RPC calls to do all your heavy lifting.
POCO Remoting gives you a very simple way of creating web services in C++ by just annotating C++ class definitions with special comments and running a code generator over it. It's commercial, but delivered with full source code. A free eval version is available. Runs on Windows, Linux, Mac OS X, etc.
I concur with imjorge's answer and add that there's a C/C++ version of the Axis2 framework (a more flexible, extensible Axis) that does SOAP via RPC and all sorts of stuff including a bunch of the WS-* specs.
http://ws.apache.org/axis2/c/
Apache axis-c:
Simple to use, but seems abandoned.. not even download pages is working for several months
WSOF WSFCPP:
Fast quickstart dev, both binded or no-binded implementation, based on Apache AxisC and it seems most of the current developers of Apache Axis is from WSOF company. Besides the Great potential I've detected a memory leak.
I'm currently using Gsoap and It has very good performance.
Gsoap "mixed notation" between old c style and some (bad?) practices for C++ bothers me some.. but this is only code-furniture.
POCO:
Is a full-feature, modern (java?) like library. It is open source software, licensed under the Boost Software License 1.0. You'll have to write some things from scrach, but with great support, utility classes and etc great library.. Innovations from c++11+ with all boost initiatives + POCO + a new Build/Dependency system more "gradle like" will certainly bring c++ to new areas of development.