0

I am an artist from new zealand. Its a media(news) header "puller", I'm not sure how it will work. I understand that this is a place for answering questions directly related to code, but here we go. Is there a way to pull <h1> headers from news sites? Through some sort of google Api system... i'm not sure what i'm talking about. Thats why I need you- A master of Code.

But ideally it would be cool, to show some sort of timeline of news headers in a visual way. For example, news headers from different sources arranged on a page with a search term.

http://www.zealmilitia.com/list.html this one is with the keyword Ukraine(all done mainly atm)

Hopefully someone sees the potential in this and wants to come on board (obviously sharing in the treasures). It could be a very cool way to share news stories on facebook etc.

I'm not a coding master but i understand some.

My question is, is this even possible?

thanks Jo

Rajat
  • 1,043
  • 12
  • 23

1 Answers1

0

You cannot really pull element from any other site due to cross origin policy : https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy

in more simple words , you cannot pull what is not yours , however you may consider using iframes , only to monitor or view what is not yours.

http://www.w3schools.com/tags/tag_iframe.asp

ProllyGeek
  • 15,517
  • 9
  • 53
  • 72
  • you cannot technically do it? or is it a legal issue? – user3554341 Apr 22 '14 at 12:12
  • @user3554341 technically you can not do it. – ProllyGeek Apr 22 '14 at 13:28
  • @ProllyGeek - the OP did not specify that this was a browser based project. It's unclear what exactly he is asking for, but why would you tell him that "technically you can not do it" when clearly something like this would be possible using some server-side code (if only we knew exactly what he wanted). – madebydavid Apr 22 '14 at 15:51
  • @madebydavid maybe if you have a better answer , you could just post it right here. – ProllyGeek Apr 23 '14 at 03:57
  • sorry for not verifying what i was asking, it doesn't matter if its a browser based or a program. So it is possible? and i can hire someone and not look utterly stupid? lol – user3554341 Apr 26 '14 at 20:32
  • @user3554341 let me say this in another way , unless you are autohrized to fetch that data , you can not do it. – ProllyGeek Apr 27 '14 at 00:58
  • please read this :http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy – ProllyGeek Apr 27 '14 at 01:01
  • but i think in your case if you want to fetch plain text , you may want to check this : http://whateverorigin.org/ – ProllyGeek Apr 27 '14 at 01:06
  • also check this please : https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS – ProllyGeek Apr 27 '14 at 01:23