I am working on development of a website. Task is to add a Live weather forecast to my webpage. I am unable to find a good working solution for this.
You can consume an RSS feed on current weather conditions from the National Weather Service. (I'm assuming US, otherwise there may be a service local to your area as well.) That information can be displayed on your site any way you like.
You can try this on AccuWeather
http://netweather.accuweather.com
I remember seeing something on code project a while ago
Through this article, I will create a
pretty ASP.NET weather control that
can be used in any ASP.NET page,
multiple times with different location
value.
There may be other examples here.
Related
I want to create a very simple online high score table for my recently developed game in Windows 8 (C# and XAML).
What's the easiest and fastet way to do this?
WITHOUT A DOUBT WINDOWS AZURE MOBILE SERVICES, and yes I'm shouting :)
All of the infrastructure you need is provided in the cloud, and you get a client SDK that makes recording the score literally a one-liner. Take a look a my blog post on doing exactly this (along with incorporating push notifications). The post covers an HTML 5/JavaScript game, but I think you'll easily be able to translate to C#/XAML.
Windows Azure Mobile Services is free*, you can get access with the Windows Azure 3-month trial offer, and after that expires you're service remains free (although you will pay for data, in your case probably $5 a month)
I would use HttpClient and simple PHP script that would be reciving scores with post method and second one that would be displaying these scores.
The first thing you need is a server that is up ALL the time and able to handle the traffic. I use Godaddy hosting. Its cheap and great service and easy to ftp to.
Next you need a php page.
The php page should grab GET data out of the URL regarding the score and user info
There are a couple ways you can implement the score recording.
1. You could have the receiving php page alter and sort a master file that contains a userid and score list
2. You could have the receiving php page save a unique txt file for each player id and stick their score in it. Then when your app calls for the scores it can pull all of the txt files and sort them on the phone.
Personally I prefer way one.
Finally you need a domain name that you can point your app too. You will need a directory for sending info and one for receiving.
I glossed over a TON of stuff. An experienced developer could do this in a day. To debug it though it would take some time. Good luck
If you're used to C#, build an ASP.NET MVC web application. You can develop and test this locally without going live. MVC may have a tough learning curve, but it's a great framework, and uses technologies you may already be familiar with as a C# coder, such as Linq. You need a database, and Visual Studio should help you get started with all of this.
You want a post or get controller action, with a url like http://server.com/scores/player1. An HTTP GET on that url could return the view of the scores, whereas a post to that url with parameters of, say, difficulty=easy and score=1100.
Your game client could use either WebClient (simpler) or HttpWebRequest for finer control. Build a class that encapsulates the scoring interaction, with a method that can get all high scores, and another method that sends a new score to the scoring server with args playername and score.
Get that up and going as a demo on your localhost, then maybe think about how to restrict players from posting their own scores, like having the game client authenticate with the server.
use service , or httpclient to update the score
Xbox live services have leader-boards support. Since you have a Win8 game you should look at this video from //build 2012 : Building Cross-Device Xbox Games, they get into useful details around 30 min into the video.
Can I use C# to auto search websites, then return the search results?
Is there a web crawler that would do the same thing if I give it a top domain (ex: I tell it find the word "funny" on stackoverflow.com, and it would tell me all the times "funny" appeared)?
These web sites allow searching via their search bar.
Do I need the web sites cooperation to automate searches?
NOTE: I only plan to be doing about one or two searches a day, so I doubt I'll be blocked, or asked to authenticate myself.
If your planning on crawling through an entire website to count words like that if you dont cache it you will get blocked, youll be requesting every page of the website essentially. Perhaps consider integrating google domain search's instead?
Here is a link to googles page detailing how to interface with c#
http://code.google.com/apis/gdata/client-cs.html
EDIT: Sorry that wasn't quite right : http://gsalib.codeplex.com/
http://answers.oreilly.com/topic/2165-how-to-search-google-and-bing-in-c/
I would look into building an RSS aggregator. RSS is standardized, so that's probably the most reliable way to collect search results from various sources.
EDIT: For sites that don't support RSS
For the sites that don't support RSS, you can look into using a screen scraper. Check out this article on The Code Project to get you started:
http://www.codeproject.com/KB/aspnet/weather.aspx
...web sites allow searching via their search bar ... Can I use C# to auto search websites, then return the search results?
Yes, if the website provides a URL where the search-term is provided as a query-string argument to a URL.
http://yourTargetDomain?searchterm=foo
But unless the website has specifically designed the search results from that URL to be structured data, the website won't "tell [you] all the times 'funny' appeared" but will send you back a search response that is suitable for a browser to display, so you would have to parse the results out of this stream of HTML.
For example:
http://philadelphia.craigslist.org/search/tls?query=ladder&srchType=A&minAsk=&maxAsk=
As a little learning project, I'd like to make a little app that reads data from a facebook users status updates. It's been done millions of times before, I'm sure, but is there an API or something? Would I need to signup for some Facebook developers license or anything, or is it as easy as finding the API, and then simply coding to it?
I'd like to simply get friends Status Updates via my login... seems easy enough. :)
The Facebook Developer links posted above are good, but it might be useful to look at some examples.
The Facebook C# SDK, found here: http://facebooksdk.codeplex.com/, has samples in ASP.NET MVC. It's a pretty simple project, so it should be relatively easy to see how things work in practice.
You can create an app at http://developers.facebook.com/
Then, download the sample project, replace the AppId and AppSecret with values from your registered app, and see how it works.
You can start reading here: http://developers.facebook.com/docs/
And look in the forum discussions here: http://forum.developers.facebook.net/index.php
This post was helpful to me http://gathadams.com/2007/06/18/how-to-write-a-facebook-application-in-10-minutes/
Also keep in mind this last change made for FB team about Post for canvas http://developers.facebook.com/docs/canvas/post/
Good luck!
I'm working on an xbl stat grabber. I have a problem I dont understand how to get the "gamer card"
Heres an example : http://www.youtube.com/watch?v=6HA-uz_v6A0&feature=related
I already have the avatar but I don't get how you can grab the stats and recent games...
You need access to the Xbox Live API, I think you have to apply to Microsoft to get on their 'Community Developer' programme, although it's a bit hazy on the site as to whether they are accepting applications or not.
One kind fellow (who I think is a Microsoft employee) saw that this was a terrible oversight from his employers decided to offer as web service that plugged into the Xbox Live network so you can pull statistics down, you can find info about it and a website here: -
http://duncanmackenzie.net/Blog/put-up-a-rest-api-for-xbox-gamertag-data
It's very comprehensive and should give you all the data you need (Gamerscore, current status, last game played etc)
EDIT: Extra stuff that might help
I'm not too familiar with C# but the process of using the service would be to do the following in your application: -
Construct your URL with a/your gamertag as the argument
Use some URL/Networking API (C#/.NET must have something like this somewhere) to load the URL and retrieve the contents. This should return you a big string containing a bunch of XML
Parse the XML into your application using some sort of XML parsing API (again, I'd imagine C#/.NET has these things built into the framework)
From the looks of the program, the gamercard info looks as if it is just an embedding based upon the gamer tag. You can find info on embedding your Xbox Live gamercard here.
The video author said the Halo stat information is coming courtesy of a site called HaloCharts.com. I don't know if he is embedding the information, perhaps reading an RSS feed, or if he is extracting data from the HTML.
What is the best way to let other parties use your website as their own content using their own style ?
We have build a small website for a customer, asp.net, .net framework 3.0. Now the customer wants other parties to be aple to use our website in their own websites while maintaining the styling of the costumers website.
I have done nothing like this before and don't even know what to google, so any help is appriciated.
I know you can do this with sharepoint, but to use sharepoint for such a small site seems like a lot of overkill
it sounds that portlets is a good name for what they want. but googling portlets draws me in the world of java and doesn't give me a lot of info on what the other parties would have to do to make it work.
a simple Iframe would probably take me a long way, but how can you get the styling done within an Iframe
webparts also sound interesting , but they seem more for in project sharing then letting people use them in their own site.
It is a small website and the logic and backend communication is pretty good contained, so a complete rework of the frond-end is not a big problem.
Once again, any help is appreciated !
Omar Al Zabir has a book on how to build a Portal in ASP.NET- here is a link to his Website.
You might want to look at his Dropthings portal.
Yes, portlets are pretty much Java-only, despite any talk of standards.
If you can encapsulate your pages in web parts or user controls, that would make it easy to style them, and even to parameterize them: a web part can be configured.
You can use Kalitte Dynamic Dashboards for creating professional dashboards and portlets.
More information can be found at www.dynamicdashboards.net