Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[ Tut ] How To Create A Live News Feed In Your App!

Hello Hackforums ✌

Today i'll be showing you how to create a live news feed in your program !

Steps :

1. Download DropBox.

- https://www.dropbox.com/downloading
Picture Below :
[img]http://s17.postimg.org/gy50fmmkv/Dropbox.jpg[/img]

2. Install Dropbox I'm sure you all know how to do that.

3. Register For Dropbox ( Unless you already have an account. )

- http://s1.postimg.org/qbsxp5e1r/Drap_Bax.jpg

Once you installed it Run it

[img]http://s27.postimg.org/scwxo3a27/minidrap.jpg[/img]

Click : DropBox Folder

Then ...

Create a Folder Called anything or just a text document.

..

http://s18.postimg.org/x85nf2fhx/uodate.jpg

Once In the folder make a text document. Name it anything you want!

http://s23.postimg.org/95up973vv/newzz.jpg

Double Click Your Text Then write your news/blog Or w/e You'd like the news box to show :)

..

http://s7.postimg.org/eopzl7iqz/fsdfsdf.jpg

Then Click Save.

Once done Right click on your text document and select " Share DropBox link "

Then it should be on your clipboard.

Now .. Go in VB

Requirements :
Your app

RichTextBox/Label/TextBar, ect..

Now Double click on your form.

It should look like this.

.. http://s30.postimg.org/jeph3krq9/Form11.jpg

That's the coding as well.

Code :

Dim Web As New WebClient
Dim Newz As String = Web.DownloadString ("URL HERE")
RichTextBox1.Text = Newz

You can change Web as anything as you want Same for Newz.

Example

Dim Hackforums As New WebClient
Dim Ducks As String = Web.DownloadString ("URL HERE")
And you don't have to have richtextbox i only put it their since i'll be using it.

You may change it if you got a label too like this.

Label1.Text = Newz

Hope you enjoyed my very firs tutorial 👍

If you got confused somewhere be sure to PM me or leave a comment i'll reply asap :)

EDIT : Project Download - https://www.dropbox.com/sh/syu4p2yjx1tly...LdQea?dl=1
This is extremely easy to do.
All we're really doing is using a webclient to grab a string.

Here are a few ideas to improve your application:
- Include an image
- Give the user a notification when a new story is posted
- Allow account creation
- Accounts can like or comment on news stories
thank you for that ;)
Helped me!

Can you create an Example Projekt ;)
(Nov 15, 2014 07:10 AM)Hawk HF Wrote:  This is extremely easy to do.
All we're really doing is using a webclient to grab a string.

Here are a few ideas to improve your application:
- Include an image
- Give the user a notification when a new story is posted
- Allow account creation
- Accounts can like or comment on news stories
Great idea , I'll be adding that right now :P


(Nov 15, 2014 07:50 AM)DownloaderO Wrote:  thank you for that ;)
Helped me!

Can you create an Example Project ;)
Sure, I'll pm you the project in a sec.🤝
Top lels, I been doing exactly this since 2013 for "auto updates". Good thread.
(Nov 15, 2014 07:50 AM)DownloaderO Wrote:  thank you for that ;)
Helped me!

Can you create an Example Projekt ;)


As you requested 🤝

- http://bitly.com/1xrq3CP

Enjoy :)

If you need any help on anything lemme know 🤗
(Nov 15, 2014 07:50 AM)DownloaderO Wrote:  thank you for that ;)
Helped me!

Can you create an Example Project ;)
Code
Imports System.Net
Imports System.IO

Function GetLiveFeed(ByVal url As String) As String

      Dim URL = "https://dl.dropboxusercontent.com/s/3cgmwwnbvzmskcl/DM.txt" 'Create String for webpage url

      Dim Request As HttpWebRequest = DirectCast(WebRequest.Create(URL), HttpWebRequest) ' Start the URL
      Dim Response As HttpWebResponse = DirectCast(Request.GetResponse, HttpWebResponse) ' Get information from URL

      Dim Reader As New StreamReader(Response.GetResponseStream) 'Returns the data from the URL Response
      Dim Strg As String = Reader.ReadToEnd 'Puts it all into a readable String
      reader.Dispose()
      Return Strg 'Makes function output Strg (the URL text)

End Function

The Link I used is up, it contains 985 i'm actually using it for something else but i dont see the harm in sharing it here for an example.
(Nov 15, 2014 10:52 AM)AEDEAD Wrote:  
Code
Imports System.Net
Imports System.IO

Function GetLiveFeed(ByVal url As String) As String

      Dim URL = "https://dl.dropboxusercontent.com/s/3cgmwwnbvzmskcl/DM.txt" 'Create String for webpage url

      Dim Request As HttpWebRequest = DirectCast(WebRequest.Create(URL), HttpWebRequest) ' Start the URL
      Dim Response As HttpWebResponse = DirectCast(Request.GetResponse, HttpWebResponse) ' Get information from URL

      Dim Reader As New StreamReader(Response.GetResponseStream) 'Returns the data from the URL Response
      Dim Strg As String = Reader.ReadToEnd 'Puts it all into a readable String
      reader.Dispose()
      Return Strg 'Makes function output Strg (the URL text)

End Function
Or you could just use the normal short and easy code.

Dim Web As New WebClient
Dim Newz As String = Web.DownloadString ("URL HERE")
RichTextBox1.Text = Newz

🤝
rather than using Web.Download , alternatively using get as above to get news posting from php setup on free/paid host flows better having an end user downloading text file forcefully just seems unethical but good share this would maybe be useful if you were going for some sort of application update ( With consent of the user of course)
{ Vi Veri Universum Vivus Vici }
(Nov 15, 2014 02:19 PM)#Kat Wrote:  rather than using Web.Download , alternatively using get as above to get news posting from php setup on free/paid host flows better having an end user downloading text file forcefully just seems unethical but good share this would maybe be useful if you were going for some sort of application update ( With consent of the user of course)

I was wondering tho how would you grab the news from the php via vb.net application?

only method i know is echo it at the website and then use web.downloadstring.
Code
dim site as webclient = new webclient()
Dim blah as streamreader = new streamreader(site.openread("url"))
thetext = blah.readtoend

also using regex if you have multiple lines you can get the most recent by timestamp or whatever your mind deems necessary

P.S sql entries can also be used for news
{ Vi Veri Universum Vivus Vici }


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Cyber-SecurityApr 9, 2024 04:47 PM 3 200 Apr 9, 2024 04:47 PM
Last Post: nucleo_type09
[Python] by streetlawkarmaJun 30, 2017 01:37 AM 1 106 Jun 30, 2017 01:37 AM
Last Post: lockhead
[Shell] by PresentcraneMay 27, 2017 11:27 AM 0 133 May 27, 2017 11:27 AM
Last Post: Presentcrane