Right now I use Gravatar for user avatars on my website.
I want to let users upload images to use as avatars from my website to gravatar so they don't have to visit gravatar if they choose not to, and I don't have to support multiple avatar methods. I don't know how to accomplish this in ASP.NET MVC.
In Ruby on Rails they made it easy; you just install a plugin. But in ASP you write the whole code yourself.
What do I need to know to get started?
Is there a Gravatar API for this?
Is there an ASP plugin with this feature?
Is there an easy way to convert Ruby code to ASP?
Gravatar does not appear to have an easy service or interface to upload avatars from other websites - they expect you to go to their website directly.
You're likely going to have to scrape their website, and act as an HTTP client to simulate the user going through the actions themselves. It's not trivial, but if you look through the Ruby code you should have a very good idea of what the general process is.
What have you tried so far?
-Adam
Related
I want to get some information of a web page (Where I have customers, current balance, etc) in my C# application. I thought in use POST - GET methods, but I don't know how to use them. The first problem, I have to login in the page:
Login page
I guess I have to get boxes id, and button id, then, complete them in the C# app. Next I want to get table contents. The table is like this: Table
How I can get customer id, customer name, and customer balance? And if the customer balance is updated, check it on the app? I think with this is to be able to do the rest on my own.
This could be very difficult depending on exactly how the site is architected. Does the site have an API you might be able to use instead of trying to go through the UI?
If you have no choice, I would consider using something like PhantomJS which is basically a scriptable headless browser. To make it a little easier to use with C#, you might also consider Selenium WebDriver and their PhantomJSDriver.
Selenium is used for automated testing of websites, but you can just as easily use it to automate repetitive UI interaction in websites. The biggest issue you generally face is keeping your scripting from being so brittle that anytime a change is made to the site, it breaks your automation. You might want to read up on the Page Object Pattern as it can help you minimize redundancy and keep your code maintainable.
Also, it was recently announced that Chrome v59 will be able to be ran headless, so that might ultimately be an alternative to PhantomJS.
Hi I am trying to pull this string from courseweb.hopkinsschools.org and display it on my own asp.net application. I have been looking for a long time for a tutorial but nothing works. Any help would be greatly appreciated.
Picture of String needed:
String
When I started doing work with websites and interfacing with other websites, I originally wanted to do what you're talking about, reading the text from pages, because thats how we as people interface with computers and websites.
But that is not how computers should ever interface with other websites unless absolutely necessary.
Moodle has an API for such things like course management. Its kind of difficult to find information on, but its called Moodle Web Services if I remember quickly. I'll add a link back if I can find it.
What these will do is let you access moodle in a computer friendly way, ie. a way your computer can easily understand, instead of trying to read webpages.
Edit
Here are some resources to get you started:
https://docs.moodle.org/dev/Web_services
https://code.google.com/p/mnet-csharp/
https://delog.wordpress.com/2010/08/31/integrating-a-c-app-with-moodle-using-xml-rpc/
https://delog.wordpress.com/2010/09/08/integrating-c-app-with-moodle-2/
I've created a website for a client of mine. It is coded in ASP.NET with C# and hosted on GoDaddy. She requires this website to updated daily by her. However, this client has very little knowledge of how to edit HTML or text within a site. I don't want to edit it every time she wants an update on the site.
What would be the best solution to my problem? I have looked up Content Management Systems, but I'm a little confused by what exactly it does in terms of coding and the management of the existing site. Does it require me to reformat the whole site to follow the CMS's 'templates'? Would it be better for me design my own back-end panel for her to edit the content (this would obviously take significant work)?
If you want to stick with a site you're developing from scratch, I'd use the HtmlEditor from the AjaxControlToolkit or a similar control, and store the html content in the database.
Then, when outputting the html from the database to the client pages, I'd make sure to use the Microsoft Anti-Cross Site Scripting Library to sanitize the html using the GetHtmlFragment() function (since this is tagged asp.net). It's not that much work, actually, if you design the database correctly, and if you've got the skills.
CMS systems are (trying not to oversimplify) entire web sites that are already built and allow people to edit the content using built-in content editing functionality. They range in functionality and extensibility from a "You get what you get and there's very little you can change" to "You can customize the heck out of it and buy or build your own modules to extend functionality." There are a lot of good ones out there, some free, and some expensive.
i'm trying to do a download manager just for learning cos i'm new in windows programming,
could someone tell me how to monitor most common web browsers,
i'd like to implement something like:
http://www.iwisoft.com/videodownloader/video-downloader-features.php
everytime you visit a web page in common browsers detects all video files in the web page and allow you to download or not the file, any idea how to do that without building an app for every browser, which is the best language to do it c#/vc++/managed/unmanaged,
i'm learning and using a mix of all to do other parts like download files, add rules to firewall or modify the registry
thanks a lot
I don't really know a neat way of doing this, but you could try the following :
Enumerate the name of the current window using GetForegroundWindow.
Check if the name you get using GetWindowText matches the usual name of the browser.
If it is a browser, moniter the clipboard and check for hyperlinks
then do your download stuff.
I program in C++ and assembly, but I wouldn't be able to advice you on the programming language since I don't have any experience with C#. But since you are new, I would suggest starting out with basic stuff. As pointed out in your comment, this is not something that can be achieved easily.
I want users to be able to upload images for profile pictures.
Are there any guidlines as to how this should best be handled?
eg - where to save the images? and folder structure to use.
- make it difficult for users to browse through everyones profile pics?
thanks.
I don't mean to be a wet blanket if your into writing this yourself, but I would just use http://en.gravatar.com
But to answer your questions directly:
Are there any guidelines as to how this should best be handled? eg - where to save the images? and folder structure to use. - make it difficult for users to browse through everyones profile pics?
Generally this is going to depend greatly on the setup of server environment. Do you have multiple web servers? Do you have a database server you want to use? Do you have an images only domain you want to use? etc.
The simplest approach is to write them to the file system and use code to retrieve them. By not writing these files into your web directory you can be sure that users cannot use this to execute code or script on your server. Useing an ASPX page to return the image content also allows you to relocate the image store at any time.
As for preventing browsing, I would just use a unique image identifier generated for each user. BTW, I would not use the user's internal "ID" field; rather, create a new id just for images.
If it is only to display a single user's picture, I would recommend to implement Gravatar instead of your own approach. There are plenty of articles out there how to implemt Gravatar with ASP.NET MVC the best.
If you really want to have your own solution, I'd recommend to give all of the user's profile pictures a random file name (for example with a GUID "3F2504E0-4F89-11D3-9A0C-0305E82C3301.jpg").