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.
In backbone.js, my understanding of communication with the server to retrieve data is cloudy at best... My current confusion is:
When you use a Collection you can fetch a set of data from the
database through the Model and filter out unwanted results. My concern
with this is that in an instance where the unfiltered results ends up
being millions of results long, this would slow things down.
I know this must not be the case of how it functions because others use backbone.js and I haven't seen this complaint before.
QUESTION:
Through backbone.js, when you fetch a set of objects where does it communicate to and how do you pass variables to specify filters for the method? For example, call to a get method that could take a user_id to return objects with the associated user_id.
If this is not the correct approach please let me know.
Explanation of how backbone.js communicates with the server, what type of interface it expects to communicate. Examples would also be very helpful.
Any help is greatly appreciated.
In the documentation there's a bit where you can pass in jQuery options. In those options you can set the "data" parameter, which is passed in as query parameters or as form parameters, depending on if it's a POST or GET.
jQuery.ajax options can also be passed directly as fetch options,
so to fetch a specific page of a paginated collection:
Documents.fetch({data: {page: 3}})
Related
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!
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.
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.
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 11 years ago.
I was wondering if you could help me - with PHP, I would like to have a system where after going through a like-gate, the customer uploads a file (I'm fine with doing this) and once they have done that the application will write a post on the users wall to tell them.
As a second stage to this, when in the admin tool for the app, the administrator puts a comment against the image that person has uploaded, we'd like the comment to go onto the customers wall - and this might be a week after.
Any help gratefully appreciated :)
You will want to use the Graph API http://developers.facebook.com/docs/reference/api/
You will need permissions from the user: http://developers.facebook.com/docs/reference/api/permissions/ Specifically publish_stream.
Posting to someone's wall is easy. From me/posts HTTP Post the correct parameters. See the post section of http://developers.facebook.com/docs/reference/api/user/
You can try it out here: http://developers.facebook.com/tools/explorer
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 11 years ago.
I just installed Railo 3 latest version on my Win7 PC. I've added a couple test variables using cfset and those output fine so i know Railo is running.
I added a simple cfdiv tag with no parameters set and when i run the page i get an error.
Then i tried another cfdiv setting each parameter that are marked as optional and i've gotten the error to disappear.
I have always used Adobe Coldfusion and I'm already starting to feel like the end result is going to be more predictable using Adobe Coldfusion. What do others think about some of the knock Coldfusion implementations like Railo and OpenBD?
CFDiv is an extension for the engine. So it is added as a CFC based custom tag. If there is anything wrong with it you could submit a patch for it since it is all written in CFML.
Although it is nice to have all tha AJAX tags I would always recommend using a javascript framework like JQuery or ExtJS.
Gert
Nothing wrong with any of them IMHO. Use whatever works best for you. =) That's the beauty of choice!