Communicate With Online Message Board [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
How might one create an application that communicates to an online website's message board, say www.espn.com's message boards that can retrieve posts, post stuff, and flag posts. How might somebody go about creating an application that does something like that? sockets?
I would like to create this in c++

This is actually more complicated than it sounds. Most message boards don't open up their API (usually to prevent spam), and if they do, you'll probably have to work with them to get the details.
The general idea is:
Open socket to their server
Send the appropriate data according to their API
Profit
If you want to hack it, you'll have to do some scraping/wireshark packet sniffing to figure out their API. There will probably be some cookies you'll have to read to get communication tokens and whatnot. It's possible, but it's a lot of work.
Some other websites (like Twitter and Google) open up their API and actually provide developer tools to interact with their data. I don't think a site like ESPN would be that open to hobbyist developers, so you'd probably have to sign some kind of agreement.
If you're really interested, read up on HTTP (here's a really simple beginning tutorial). Most APIs are built on the HTTP protocol, so you'll want to become very familiar with it. I'd recommend using something besides C++ though, since socket work can be a bit tedious. Try something like Python.

Related

How can I programmatically get the hot topic of the day/hour/moment? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I would like to grab the current hot topic when my page loads (it could be anything from a civil war in Syria to a sports team or a wardrobe malfunction). I would like it to be a simple web service call such as:
string hotTopic = getHotTopic();
..but that probably "ain't gonna happen."
So what can I realistically expect? In brainstorming this, I thought of grabbing the headlines on the New York Times, the Huffington Post and a couple of other sites, and then parsing the h1 tags in the html to look for non-common words that appear multiple times. Am I on the right track? Is there a known solution to this challenge?
One can always pull down the RSS feeds from a website and parse those out - however not every website is going to provide a "View-Count" for the articles you're pulling down (making it hard to determine whether or not it is a hot topic).
I personally would go to Twitter for trending topics - often times the trending words or hashtags coincide with what's really trending in the news. Events like the Superbowl or a weather catastrophe are often showing there.
To achieve your one method solution, you'll likely need to write a wrapper. If you're using the Twitter API there are some pre-made libraries you could use that help achieve this. The wrapper would be something like:
(Completely made up code)
string GetHotTopic()
{
var svc = new TwitterSvcWrapper();
var topics = svc.GetTrending("united states");
return topic[0].text;
}
I know this doesn't necessarily allow you to parse several pages and find some topics, but perhaps it gives you a method to discover what may be trending. To go against my own idea, Twitter isn't always the best place either. Silly items can be trending that you may not want to use, like "#whatToSayAfter" ...
I also wanted to add that some websites state it to be against their Terms of Use to "scrape" data. For example, (not that you would use it), but Xbox.com prohibits you from scraping data in their ToS. (1.12)
Just some ideas - good luck!
Cheers!

Sending data securely in C++? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Can someone give me some guidance on my problem - I am writing a game (CryEngine) and I need to know how to send data - including usernames and passwords to a server where they can be stored in a database and shown on a webpage displaying the players "stats". I'd like to start with the usernames and passwords as they are the most paramount that I get right, the other stuff really doesnt have to be encrypted. Although, it might make it a bit harder for hackers to alter their stats.
So how would I approach doing this? I know my way around C++ and I have been using it for a while, I have already built a system that stores and captures the player's kills and XP etc. but this bit sounds more tricky. It sounds like I'm going to make heavy use of BOOST and possibly OpenSSL, but having never used these libraries before or having to make a secure system, I'm slightly confused. Any help or general directions are greatly appreciated!
Open SSL sounds solid, have a look here: http://www.ibm.com/developerworks/linux/library/l-openssl/index.html .
You can use almost every crypting library for this (better not writing your own stuff) but since it is client/server anyway, using a protocol/system that was designed to do exactly this, your best bet is openSSL.
The rest is a secured server with some sort of application running on it (Java EE) and handling the entries in some sort of database.
Then choose some web-language of your preference to retrieve database entries.
PS: dont do it live (eg. every headshot is an entry) but transmit the final results of a round, or once every X minutes.
I suggest using HTTPS.
Link against libcurl and with a few cookbook examples from the net you can have your client portion ready in a couple of minutes or hours. Fiddling with OpenSSL by hand could take days or weeks if you are new to it.
For the server part you can use your game's existing web server. Your game is going to have a web site, isn't it? The users will be able to access their stats via their web browsers too.
If you want to protect the score update mechanism, use regular cryptography API like crypt and a key hidden in the code to obfuscate/deobfuscate the player's score update password. It's obfuscation, not encryption, since the key ultimately resides on the client machine and can be recovered with a debugger.

Things i need to know to build a real time feed system in Django [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I want to build a simple app where i have different users and they make updates and all the users get the updates in real time much like facebook.
Edit:
I just want to know how to push updates to profiles of users without them reloading the page. Do i make repeated AJAX calls or is there something out there that can solve this problem for me.
Edit 2:
Here's a presentation which helped me http://www.slideshare.net/oellegaard/implementing-real-time-web-applications-with-django
for real-time like interaction, one idea is to use sockets.
What I would do is write my front facing site in python/django, and have a node.js layer behind that w/ socket.io (websockets) that handles keeping all of the clients in sync.
[DB]
/ \
[Django] [node.js]
app logic -> \ / <- async updates
[Browser]
but really this is a fairly uninformed answer based heavily on assumptions b/c you haven't told us anything concrete about what your site needs to do.
You need to know how to Program, you need to know Python, and the Django Framework, you will need to know HTML, JavaScript, and CSS, you will need to know some Database of your choice, you will need to know enough to make educated decisions about MVC frameworks on the Client Side, you will need to know about Queues, Stacks, Asynchronous Callbacks, HTTP methods, Encryption and other Security Practices, the list goes on.
Basically, you need to know more then someone who would ask the question you asked.

Save Data permanently [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am working on a project with qt, I need to save data(file path and password) permanently so I can get it or modify it any time even when I exit my application and rerun it.
I thought to solve it with an encrypted xml file but I want to do it without trace.
You either use a file or some other platform specific database mechanism, like Windows' registry. But then it would leave a trace; you can't hope to store something locally and don't leave a trace without rootkiting the operating system (and even that would leave a trace in the hardware, after all, you are writing your data to the drive).
One thing you can hope to do without leaving a trace, is to store the data remotely in some server via the network, since network activity usually is not logged (but can be observed), but I can see 2 problems with this approach:
1) it may be pose some privacy concern to your user (if I were an user of your application, I would not like too see my data sent over the wire to an unknown server);
2) how could you identify the information so that you can retrieve it? You could use some hash with the user name and computer hard drive id and network interfaces MAC adresses, but if some of these change, the data would be lost. You could also generate an unique id for each installation of your application, but it would require you to store that ID locally, and that would be a trace.
Local cryptography to prevent reading/tampering with the data is inherently insecure, because you will need to have some repeatable mean to retrieve the key. How would you do it? If you simply hardcode it in your application, it is easily retrievable by some binary file reader. It can't be on a file named 'key.txt', for obvious reasons. You can compute it at runtime with some complicated algorithm, but you will always need to have it loaded into memory at some point, from where it can be retrieved by someone willingly enough.
It is certainly not possible to save something on the computer without a trace. Everything is visible to root user.
But if you do not want to let others to change it, you can encrypt it, hide it and set it read-only and root edit permission only. But not to let any one find it is impossible. (are you trying to make a virus?) Even if you put in the BIOS, there is way to find it.

Audio streaming using C++ tutorial and sample code [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I would like to learn basics of audio streaming. In particular, I would like to learn how to capture audio from a computer mic, and in real time stream it so that another user can listen to it live. I would like to do it on Windows.
Is there any good tutorial that explains how it is done and some sample C++ code that I can take a look for more details?
Also I heard ASIO provides a low latency library, so I am interested in that.
Maybe here would be a good place to start, if you're using Windows?
Have a read of that page and look at the WASAPI as well.
You can capture raw audio directly from the device using the IAudioCaptureClient
I have been involved in projects involving real time streaming of audio and have used aac as the audio format and Live555 for a streaming library. These might be a good place to start.
For recording and playing audio on Windows I would recommend the waveform audio API. You have an example here for recording data from the mic.
For the streaming part, if you want to use an already available multimedia streaming server, i would recommend icecast, with its API lib.
If you want to implement the network streaming by yourself, then you can use the asio lib. You have some examples here.
For audio playback on the client side, there is a tutorial using waveform API here.