9 Replies - 1472 Views - Last Post: 21 April 2014 - 07:14 AM

#1 fishpond  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 14-December 13

Programmatically Access a Website

Posted 20 April 2014 - 04:33 PM

Summary:

I'm trying to think of a way to programatically access a website, log in, do some stuff, and log out.

Details:

I'm writing an application that connects to my database from my website. Problem is, since the database is from my website, it requires that I log in to my website account and add the IP address of the current place I'm working at as a remote connection.

I'm hoping you guys can help me think of a way I can have the application I'm working on to do all this automatically for me when it starts up.


Thanks for your time.

Fishy

This post has been edited by fishpond: 20 April 2014 - 04:34 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Programmatically Access a Website

#2 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 736
  • View blog
  • Posts: 3,221
  • Joined: 03-December 12

Re: Programmatically Access a Website

Posted 20 April 2014 - 04:47 PM

Do what kind of stuff? If you are looking at doing this programmatically you should know what you want to do before hand, it also sounds like you want a cron job.
Was This Post Helpful? 0
  • +
  • -

#3 fishpond  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 14-December 13

Re: Programmatically Access a Website

Posted 20 April 2014 - 05:07 PM

I explained to you what I wanted to do...It's not a "cron job".

I have an application that runs with the database from my website. However, to be able to have access to the database, I have to manually enter my current IP address into the remote database system.

I move around a lot so I would like to be able to have my application automatically check and do this for me every time I start it.

So I think it's going to have to connect to an http link...somehow log in with my credentials...and then click a link button called "Add" on that page, then log out. I guess it doesn't have to log out.

This post has been edited by fishpond: 20 April 2014 - 05:08 PM

Was This Post Helpful? 0
  • +
  • -

#4 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 736
  • View blog
  • Posts: 3,221
  • Joined: 03-December 12

Re: Programmatically Access a Website

Posted 20 April 2014 - 05:32 PM

Does the remote site have an API?
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5595
  • View blog
  • Posts: 11,971
  • Joined: 02-June 10

Re: Programmatically Access a Website

Posted 20 April 2014 - 06:28 PM

If its your website then can't you write a call to log you in? As Astonecipher hinted at just add an API call.

Or is it really not your site? Sounds almost like you're really trying to log into a site that doesn't support programmatic acces and we don't help with bypassing site security or terms of us.

So this site of 'yours'.... What's the URL?
Was This Post Helpful? 0
  • +
  • -

#6 fishpond  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 14-December 13

Re: Programmatically Access a Website

Posted 20 April 2014 - 07:12 PM

I had hoped I had hung around here enough for people to trust me...but if you really need to know, my website is www.fishpondstudio.com and its hosted by bluehost. To my knowledge, bluehost does not have any API's I can use for this...

Since I didn't buy the privacy package you can google my website and see that I am the owner.

Anyways, I think I have an idea how to do it...Since I'm creating a .NET program, I should just be able to use the HttpWebRequest class.

If you guys have any more advice, I'd really appreciate it.


Thanks
Was This Post Helpful? 0
  • +
  • -

#7 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 736
  • View blog
  • Posts: 3,221
  • Joined: 03-December 12

Re: Programmatically Access a Website

Posted 20 April 2014 - 07:19 PM

30 posts in four months is been here a while?

I think your approach is wrong personally. You have a website accessible from anywhere on any device. Why make a desktop app so you can interact? Do you program online as a backdoor to your site. Then it doesn't need the ip accessibility, you can interact with your database, you can use any device you have prepared for without needing to download extra software.

This post has been edited by astonecipher: 20 April 2014 - 07:21 PM

Was This Post Helpful? 1
  • +
  • -

#8 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3631
  • View blog
  • Posts: 11,327
  • Joined: 05-May 12

Re: Programmatically Access a Website

Posted 20 April 2014 - 07:33 PM

Oh, I see. It's because you are trying to directly access your MySQL database:

Quote

Dynamic IP Addresses

Having a dynamic IP address means that the connecting IP address can change periodically depending on the Internet Service Provider (ISP). You must update the connecting IP in Remote MySQL every time it changes.

(from Remote Database Connection Setup)

My first recommendation, is don't access the database remotely unless you are in there to do some kind of maintenance. For development work, always work locally accessing a local MySQL database. Something is wrong if you are doing testing against live production data. If you need to test against production data, make a clone locally... that would be the time to whitelist your IP, perform an export and then remember to remove the white list entry.
Was This Post Helpful? 0
  • +
  • -

#9 fishpond  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 14-December 13

Re: Programmatically Access a Website

Posted 20 April 2014 - 10:59 PM

View PostSkydiver, on 20 April 2014 - 07:33 PM, said:

Oh, I see. It's because you are trying to directly access your MySQL database:


Yea this guy gets me.

I've been having a problem with MySQL on my machine...So I've been using the database from my website.... :/

I know it's stupid but it's actually kind of useful if I have to switch working machines.


View Postastonecipher, on 20 April 2014 - 07:33 PM, said:

30 posts in four months is been here a while?

I think your approach is wrong personally. You have a website accessible from anywhere on any device. Why make a desktop app so you can interact? Do you program online as a backdoor to your site. Then it doesn't need the ip accessibility, you can interact with your database, you can use any device you have prepared for without needing to download extra software.


I just realized how little I've posted. I'm usually always lurking the forums reading so I always feel like I'm on this site a lot lol. I guess people don't really see me when I'm not even logged in.

I do want to create a web application one day...just not yet...I just started this project yesterday actually to learn to use WPF using C#.

Thanks for all the replies guys.

Fish
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9426
  • View blog
  • Posts: 35,422
  • Joined: 12-June 08

Re: Programmatically Access a Website

Posted 21 April 2014 - 07:14 AM

What you should be doing is setting up a "web service" that would act as the middle man between your desktop app and your database hosted out on the web. Poke around that search term and you should be on the right path.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1