Announcement

Collapse
No announcement yet.

CNN Breaking News script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • stevea
    replied
    I guess I'm not very observant, so I didn't notice electron (the original author of the CNN script) has written my.alert. I haven't tried it or even looked at it in detail, but it looks as though it may make the CNN Breaking News script somewhat obsolete. I'll probably keep using the old script, but unless there is some compelling reason I don't think I'll post any new versions. You all should take a look at my.alert.

    Steve

    Leave a comment:


  • stevea
    replied
    Today CNN has been posting lost of "CLICK HERE" and "CLICK TO WATCH" stuff on their breaking news. Obviously that isn't breaking news. I've modified the script to catch and ignore these. I'll test it for a bit and then post the changed version.

    If anyone is seeing other types of these that should be ignored, please let me know (your history of breaking news items will be in CNNsettings.ini, in the config directory).

    Steve

    Leave a comment:


  • stevea
    replied
    Originally posted by Pete View Post
    Been seeing these on and off all day. I did though get a couple of alerts today. Anyone else seeing them?
    Pete,

    I could take a look at it, but it's an HTTP Error 502, which I think would normally mean there was some issues on and between the CNN servers. Not much I could do differently, although I could probably trap the error and avoid the error message. It still wouldn't get the breaking news.

    Steve

    Leave a comment:


  • Pete
    replied
    Messages went away a few hours later. Most interesting though was to watch "System.Net.WebException" message for a few hours.

    Leave a comment:


  • Pete
    replied
    Been seeing these on and off all day. I did though get a couple of alerts today. Anyone else seeing them?

    8/24/2012 7:20:04 PM CNN Alerts GetPage::Error while retrieving web page: System.Net.WebException: The remote server returned an error: (502) Bad Gateway. at System.Net.HttpWebRequest.GetResponse() at scriptcode13.scriptcode13.GetPage(String Url)
    8/24/2012 7:22:46 PM CNN Alerts GetPage::Error while retrieving web page: System.Net.WebException: The remote server returned an error: (502) Bad Gateway. at System.Net.HttpWebRequest.GetResponse() at scriptcode13.scriptcode13.GetPage(String Url)

    Leave a comment:


  • Pete
    replied
    Thanks Steve for the update! Its been working well with no issues.

    Leave a comment:


  • stevea
    replied
    I should have mentioned, but forgot: Upgrading to v3.4 only requires dropping in the main script Custom_CNN.vb in place of the previous one in your scripts directory.

    Steve

    Leave a comment:


  • stevea
    replied
    v3.4 posted

    The Custom_CNN script in the Library thread (here: http://board.homeseer.com/showpost.p...50&postcount=1) has been updated with v3.4 of the Custom_CNN VB.NET script. Although I only changed a couple of things, most people will find this is a dramatic change in use: It will report MANY more breaking news alerts.

    In trying to track down the problems Pete reported above, I decided to do some real digging., I put in some debug, creating a file of data scraped from CNN.com each time an alert was detected (just the relevant section of the page). I ran it for an entire day, and found that over 70 files were created, even though not a single breaking news announcement was made! I started looking at each file, and each one did indeed have a legit breaking news story (although only three unique ones for that day).

    In examining the code and each of these files, I found that although the code went through lots of effort to find and extract the news item, it just couldn't handle every case. So I tried a simple approach, and simply stripped out all the HTML. To my amazement, it left only the exact text that I would want to put in the breaking news announcement!

    I've run it for a few days now, and Pete has run it for a bit less. It seems to work pretty well, and consistently. I'm certain people will not be missing any breaking news items now. I'll leave it to each of you to decide if that is a good thing or a bad thing....

    As always, post any issues or questions here in this threa.

    Steve

    Leave a comment:


  • Pete
    replied
    Thank you Steve.

    Leave a comment:


  • stevea
    replied
    Pete,

    My UltraLog does show the same error at about the same time as your first one (I didn't check the others, but I'm convinced). So, I need to figure out what is causing it.

    I just looked at the code you posted. Your additons certainly shouldn't be introducing any problems, but the extra SNEVL code that is in there should have come out. Once I did Snevl_bb for the BetaBrite, I don't use the stuff that I had hard coded in there. Anyway, I'll take it out of whatever I post next.

    Steve

    Leave a comment:


  • stevea
    replied
    Originally posted by Pete View Post
    I added the following to the script (so it might be my fault) but haven't seen any errors with the changes I did in over a week or so. I did this because I was annoyed with the constant wave file / TTS stuttering that I've seen with the betas. Meanwhile downgraded to previous version without the "hs.WaitEvents". It still showing email sent successfully though?
    ...
    Looked at some older logs and saw that sometimes email wouldn't go out and I would see an email error. Now I do not see the email going out error (rarely) but rather this error. It could be due to the "hs.WaitEvents" statement maybe?
    Pete,
    Interesting. It looks like it is failing on the time AFTER it does your email and stuff, 3 minutes later. My guess is that what I thought I had fixed, I didn't. Let me look at it some more. Sorry about that.
    Steve

    Leave a comment:


  • Pete
    replied
    I added the following to the script (so it might be my fault) but haven't seen any errors with the changes I did in over a week or so. I did this because I was annoyed with the constant wave file / TTS stuttering that I've seen with the betas. Meanwhile downgraded to previous version without the "hs.WaitEvents". It still showing email sent successfully though?

    Sub announce(ByVal msg)
    Dim snevl as Boolean = (UCase(hs.GetIniSetting("snevl","use_snevls_betabrite","no", "CNNsettings.ini")) = "YES")
    If speak Then
    If snevl Then
    hs.RunEx("speaker_announce.vb","BeforeAnnounce","")
    End If
    If playwav Then
    dbg("playing " & wavfile)
    hs.SetVolumeEx (3)
    hs.WaitEvents

    hs.PlayWAVFile(wavfile)
    hs.WaitEvents
    End If
    hs.SetVolumeEx (3)
    hs.WaitEvents
    hs.speak("Your attention please. This is a C N N breaking news alert.")
    hs.WaitEvents
    hs.speak(msg)
    hs.WaitEvents
    hs.SetVolumeEx (20)
    hs.WaitEvents

    End If
    ' SNEVL added the following four lines
    If snevl Then
    hs.RunEX("bb_funcs.vb","bb_message_a",msg & chr(13))
    hs.DelayTrigger(120 , "Clear BetaBrite")
    End If
    End Sub
    Here what I see in Ultralog.

    5/20/2010 4:34:25 PM Device Control Command sent to News CNN-News: Y10 ON Dimval: 0 Data: 0
    5/20/2010 4:34:37 PM email Email successfully sent to 5555551212@txt.att.net
    5/20/2010 4:37:20 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    5/20/2010 4:40:20 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    5/21/2010 12:34:26 PM Device Control Command sent to News CNN-News: Y10 ON Dimval: 0 Data: 0
    5/21/2010 12:34:31 PM email Email successfully sent to 5555551212@txt.att.net
    5/21/2010 12:40:20 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    5/21/2010 9:19:24 PM Device Control Command sent to News CNN-News: Y10 ON Dimval: 0 Data: 0
    5/21/2010 9:19:28 PM email Email successfully sent to 5555551212@txt.att.net
    5/21/2010 9:25:19 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    5/21/2010 9:28:19 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    5/21/2010 9:31:19 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    5/21/2010 9:34:19 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    5/21/2010 9:37:19 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    5/21/2010 9:40:20 PM Error Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    Looked at some older logs and saw that sometimes email wouldn't go out and I would see an email error. Now I do not see the email going out error (rarely) but rather this error. It could be due to the "hs.WaitEvents" statement maybe?
    Last edited by Pete; May 22nd, 2010, 10:59 AM.

    Leave a comment:


  • stevea
    replied
    Arghhh!

    Pete,

    About what time did you get that in the log? I'm assuming I should be able to find something similar in my log, if it was this script.

    It seems odd that everything seemed to work. It appears that I don't catch that error, so the script should have aborted.

    Steve

    Leave a comment:


  • Pete
    replied
    Not sure if its related to most current beta but been getting these after a CNN news alert.

    Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at scriptcode2.scriptcode2.Main(String strMode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)
    The email notification goes out, TTS works and variable gets updated. Downgraded to V31 to see if there is a difference.
    Last edited by Pete; May 22nd, 2010, 05:51 AM.

    Leave a comment:


  • Pete
    replied
    Thanks for your continued support of the script Steve.

    Leave a comment:

Working...
X