kevin stowe

kevin stowe

  • NA
  • 2
  • 0

Little help on a program im writing

Dec 29 2006 11:26 AM
let me introduce my self first, my name is kevin, i live in ohio... ive been programming as a hobby off and on for about 4 years and im new to c#

The program im working on is to check a myspace... ive already automated the login process but i need to use MSHTML to need if new comments, images have arrived.... now the code i have now is.

mshtml.IHTMLDocument2 document1 = (mshtml.IHTMLDocument2)this.web.Document;

text = document1.body.outerHTML;

StreamWriter writer1 = new StreamWriter("C:/t.txt");

writer1.Write(text);

writer1.Close();

this writes it to the text... now of course i figured i could just do an Indexof("New Comments") but...

myspace website code is wierd.. take a look at this..

<DIV class="show indicator" id=indicatorMail><A id=ctl00_Main_ctl00_MessageCenter1_Indicators1_MessageHL href="http://messaging.myspace.com/index.cfm?fuseaction=mail.inbox&amp;MyToken=7ff09815-afe3-4ce6-8ac3-0eceb1aaf0f0"><IMG class=indicator alt="" src="http://x.myspace.com/images/icon_envelope.gif" align=middle> <SPAN class=txtRed>New Messages! </SPAN></A></DIV>
<DIV class="hide indicator" id=indicatorFriendRequest><A id=ctl00_Main_ctl00_MessageCenter1_Indicators1_HyperLink1 href="http://messaging.myspace.com/index.cfm?fuseaction=mail.friendRequests&amp;MyToken=7ff09815-afe3-4ce6-8ac3-0eceb1aaf0f0"><IMG class=indicator alt="" src="http://x.myspace.com/images/icon_envelope.gif" align=middle> New Friend Requests!</A> </DIV>
<DIV class="hide indicator" id=indicatorComments><A id=ctl00_Main_ctl00_MessageCenter1_Indicators1_HyperLink2 href="http://comment.myspace.com/index.cfm?fuseaction=user.viewComments&amp;friendID=20010775&amp;MyToken=7ff09815-afe3-4ce6-8ac3-0eceb1aaf0f0"><IMG class=indicator alt="" src="http://x.myspace.com/images/icon_envelope.gif" align=middle> New Comments!</A> </DIV>
<DIV class="hide indicator" id=indicatorImageComments><A id=ctl00_Main_ctl00_MessageCenter1_Indicators1_HyperLink3 href="http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&amp;friendID=20010775&amp;MyToken=7ff09815-afe3-4ce6-8ac3-0eceb1aaf0f0"><IMG class=indicator alt="" src="http://x.myspace.com/images/icon_envelope.gif" align=middle> New Picture Comments!</A> </DIV>
<DIV class="hide indicator" id=indicatorBlogComments><A id=ctl00_Main_ctl00_MessageCenter1_Indicators1_HyperLink4 href="http://blog.myspace.com/index.cfm?fuseaction=blog.controlcenter&amp;MyToken=7ff09815-afe3-4ce6-8ac3-0eceb1aaf0f0"><IMG class=indicator alt="" src="http://x.myspace.com/images/icon_envelope.gif" align=middle> New Blog Comments!</A> </DIV>
<DIV class="hide indicator" id=indicatorBlogs><A id=ctl00_Main_ctl00_MessageCenter1_Indicators1_HyperLink5 href="http://blog.myspace.com/index.cfm?fuseaction=blog.controlcenter&amp;MyToken=7ff09815-afe3-4ce6-8ac3-0eceb1aaf0f0"><IMG class=indicator alt="" src="http://x.myspace.com/images/icon_envelope.gif" align=middle> New Blog Subscription Posts!</A> </DIV>
<DIV class="show indicator" id=indicatorEvents><A id=ctl00_Main_ctl00_MessageCenter1_Indicators1_HyperLink6 href="http://messaging.myspace.com/index.cfm?fuseaction=mail.eventInvite&amp;MyToken=7ff09815-afe3-4ce6-8ac3-0eceb1aaf0f0"><IMG class=indicator alt="" src="http://x.myspace.com/images/icon_invite_b_white.gif" align=middle> New Event Invitation!</A> </DIV>
<DIV class="hide indicator" id=indicatorBirthday><A id=ctl00_Main_ctl00_MessageCenter1_Indicators1_HyperLink7 href="http://collect.myspace.com/index.cfm?fuseaction=user.birthdays&amp;friendID=20010775&amp;userName=Kevin&amp;MyToken=7ff09815-afe3-4ce6-8ac3-0eceb1aaf0f0"><IMG class=indicator alt="" src="http://x.myspace.com/images/icon_present.gif" align=middle> New Birthdays!</A> </DIV>
<DIV class="hide indicator" id=indicatorVideoComments><A id=ctl00_Main_ctl00_MessageCenter1_Indicators1_HyperLink8 href="http://vids.myspace.com/index.cfm?fuseaction=vids.myvideos&amp;MyToken=7ff09815-afe3-4ce6-8ac3-0eceb1aaf0f0"><IMG class=indicator alt="" src="http://x.myspace.com/images/icon_envelope.gif" align=middle> New Video Comments!</A> </DIV>


as you can see they made up a table and depending on if you have them or not it changes its class to show inficator or hide indicator.... now my question is...isnt there a way with mshtml that i can goto a specific ID like id=indicatorVideoComments and then see if the class is hidden or showing, thus indicating you have new messages...ect? im not sure where to look for a code like this so any help on this would be appreciated.