I am created a personalized search web application .I will create a signup,login and user will fill in his interests based on that i have a doubt in search
I only want to use PHP and JAVA Script alone.
1)After redirecting to that specific search page from login, when i type a specific keyword in that,all i need is ,I need to display results in that domain/web application by fetching the results from search engines.the results should be web content articles,image,video,news.
My doubts is how can i get the feeds from search engine to get displayed in my application such that the keyword which is provoked to search in the search tab should refer to match the user interests which is stored in the database based on this,it should provide the results.
I hope you friends understood the problem statement of this application.
Please help me solve this problem and if any code/book related to this,please tell me.
This isn't a well written question so I'm not entirely sure what you're asking. I interpret the problem as this:
You want a website that registers users with specified interests
You want those users to see tabulated results based on their interests (with the results being lifted from search engines).
The above being a correct interpretation, I would suggest you use something like the "curl" function, mentioned previously on Stackoverflow:
How to get Content ot Remote HTML page
In the above example, the URL specified would (in your case) contain the search engine string. Say you were searching for "bricks in china", then your url string that would be passed to the curl function, would be "https://www.google.co.zw/search?q=bricks+in+china&oq=bricks+in+china"
Another good example of tackling this problem (outside of the Stackoverflow community) is presented here: http://davidwalsh.name/curl-download
Hope that helps :)
Related
My friend started a blogging website using wordpress for students to write on topics like world affairs, british politics etc. He is a philosophy student so himself doesn't any coding or web development and hence asked me since I'm doing a computer science degree to help him modify the search on his website. Basically the issue is that the search works normally except when you want to use it to search by articles written by a specific author. For example if you write the name of a person, all the articles written by him/her should be displayed. I have no experience in web development but watched loads of videos on youtube on how to customise the search but most of them just show to change its position on the page or just how it looks and none the way I want to specifically customise it. Are there links to any videos on youtube or articles that explain how to do it or what should I do to customise the search in this way?
I have been telling him for the past week that I will help in because I was confident I would have solved the problem but since I actually started trying the past couple days, I've seen so many ways it could go wrong from ftp to messing up the whole website. I'm sure if it's not clear enough or my question is stupid, I thought for a while before posting this on stack overflow.
MODIFY YOUR THEME’S SEARCH.PHP FILE
What we want to do is first take a look at the current search results page. If your theme is not presenting a search bar to make an actual search query, then you can simply append the following to your site’s URL : yoursite.com/?s=your+search+string.
Passing this query will send you to the search results page. Ideally your query should actually produce results so you could try to use a general search phrase that you know will produce multiple results.
Once you have a good idea as to how the results looks now, you can visualize a clear direction as far as how you want it to look. The search.php file usually starts with the following link :
this link
I am creating a small blog-like website, and i would like to integrate the option to tag other users on comments or post using the # symbol like facebook or twitter does. I have searched throughout the website and haven't found anything similar nor do i know what this is called.
My question is, what programming language would i need to do this? taking in count that you can press the # symbol anywhere in the comment box, a list of your friends will pop up. i am making my website using PHP and MySQL. I would like to know any tips, tutorials or advice on how to do this.
In order to make a "#" functionality for your website will have to use ajax, PHP,and MySQL. Where ajax makes a call to a PHP file that pulls up and searches through the user's friend list and displays what friend the person is looking for. Also, you will have to make sure that as the user types that friend list keeps is constantly searched and shortened so the user can easily find the person they are looking for.
I need to figure out how to (if it is possible) populate html/php page with following information:
I have a url of a page and a set of keywords, I'd would like to check every week what position in google search results is that url, if search is preformed for that set of keywords that is associated with it.
Say if it is on a second page of google it will have position of 18 etc.. (count starting from first result on first page).
I then have a html/php page with a table structure which has a column with urls, another column with keywords associated to those urls. Than there should be two more columns which contain information of position in google's search and date when that position was checked (so these two columns should be populated by that script that checks the position).
I'm gona be honest, I have no idea how to achieve this nor as I know if it is possible. Please suggest ideas, code snippets, maybe some services that do this kind of stuff.
To scrape Google's result pages, have a look here.
But note, that Google's former SOAP API does no longer exist. This I wonder, that it is legal to scrape Google's pages. See this Google blog page and Google's Terms of Use.
Google writes this:
Automated searching is strictly prohibited, as is permanently storing any search results. Please refer to the Terms of Use for more detail.
I am creating a classifieds website.
Im storing all ads in mysql database, in different tables.
Is it possible to find these ads somehow, from googles search engine?
Is it possible to create meta information about each ad so that google finds them?
How does major companies do this?
I have thought about auto-generating a html-page for each ad inserted, but 500thousand auto-generated html pages doesn't really sound that good of a solution!
Any thoughts and idéas?
UPDATE:
Here is my basic website so far:
(ALL PHP BASED)
I have a search engine which searches database for records.
After finding and displaying search results, you can click on a result ('ad') and then PHP fetches info from the database and displays it, simple!
In the 'put ad' section of my site, you can put your own ad into a mysql database.
I need to know how I should make google find ads in my website also, as I dont think google-crawler can search my database just because users can.
Please explain your answers more thoroughly so that I understand fully how this works!
Thank you
Google doesn't find database records. Google finds web pages. If you want your classifieds to be found then they'll need to be on a Web page of some kind. You can help this process by giving Google a site map/index of all your classifieds.
I suggest you take a look at Google Basics and Creating and submitting SitemapsPrint
. Basically the idea is to spoon feed Google every URL you want Google to find. So if your reference your classifieds this way:
http://www.mysite.com/classified?id=1234
then you create a list of every URL required to find every classified and yes this might be hundreds of thousands or even millions.
The above assumes a single classified per page. You can of course put 5, 10, 50 or 100 on a single page and then create a smaller set of URLs for Google to crawl.
Whatever you do however remember this: your sitemap should reflect how your site is used. Every URL Google finds (or you give it) will appear in the index. So don't give Google a URL that a user couldn't reach by using the site normally or that you don't want a user to use.
So while 50 classifieds per page might mean less requests from Google, if that's not how you want users to use your site (or a view you want to provide) then you'll have to do it some other way.
Just remember: Google indexes Web pages not data.
How would you normally access these classifieds? You're not just keeping them locked up in the database, are you?
Google sees your website like any other visitor would see your website. If you have a normal database-driven site, there's some unique URL for each classified where it it displayed. If there's a link to it somewhere, Google will find it.
If you want Google to index your site, you need to put all your pages on the web and link between them.
You do not have to auto-generate a static HTML page for everything, all pages can be dynamically created (JSP, ASP, PHP, what have you), but they need to be accessible for a web crawler.
Google can find you no matter where you try to hide. Even if you can somehow fit yourself into a mysql table. Because they're Google. :-D
Seriously, though, they use a bot to periodically spider your site so you mostly just need to make the data in your database available as web pages on your site, and make your site bot-friendly (use an appropriate robots.txt file, provide a search engine-friendly site map, etc.) You need to make sure they can find your site, so make sure it's linked to by other sites -- preferably sites with lots of traffic.
If your site only displays specific results in response to search terms you'll have a harder time. You may want to make full lists of the records available for people without search terms (paged appropriately if you have lots of data).
First Create a PHP file that pulls the index plus human readable reference for all records.
That is your main page broken out into categories (like in the case of Craigslist.com - by Country and State).
Then each category link feeds back to the php script the selected value regardless of level(s) finally reaching the ad itself.
So, If a category is selected which contains more categories (like states contain cities) Then display the next list of categories. Else display the list of ads for that city.
This will give Google.com a way to index a site (aka mysql db) dynamically with out creating static content for the millions (billions or trillions) of records involved.
This is Just an idea of how to get Google.com to index a database.
I'm trying to enter a list of items into Google Base via an XML feed so that, when a user searches for one of these items and then clicks the search result link in Google Base (or plain Google), the user is directed to a dynamic Web page on my Web site. I'm assuming that the only way to specify a specific link (either static or dynamic) is through the attribute in the XML feed. Is that correct? So, for example, if my attribute is:
http://www.example.com/product1-info.html
the user will be directed to the product1-info.html page.
But if, instead of a static product page, I want to have the user redirected to a dynamic page that generates search results from my local database (on my Web site) for all products containing the keyword "product1", would I be able to do something like this?:
http://www.example.com/products.php?productID=product1
Finally, and most importantly, is there any way to specify this landing page (or any specific landing page) from a "regular" Google search? Or is it only possible via Google Base and the attribute? In other words, if I put a bunch of stuff into Google Base, if any of it shows up in a regular Google search, is there a way for me to control what parameters get passed to the landing page (and thus, what search is performed on the landing page), or is that out of my control? I hope I explained this correctly. Thanks in advance for any help.
first question: Yes, urls containing a query_string part are allowed.
http://base.google.com/support/bin/answer.py?hl=en&answer=78170 says:XML example:
<link>http://www.example.com/asp/sp.asp?cat=12&id=1030</link>
--
Let me rephrase the second question to see if I understand it correctly (might be completely on the wrong track): E.g. products.php?productID=product1 performs a db-search for the product "FooEx" and products.php?productID=product2 for "BarPlus". Now you want google to show the link .../products.php?productID=product1 but not ....?productId=product2 if someone searched for "FooEx" and google decided that your site is relevant? Then it's the same "problem" we all face with search engines: communicate what each url is relevant for. I.e. e.g. have the appropriate (and only the appropriate) keywords appear in the title/h1 element of the page, avoid linking to the same contents with different urls (e.g. product.php?x=1&productId=1 <-> product.php?productId=1&x1, different urls requesting most probably the exact same contents), submit a sitemap, and so on and on....
edit:
and you can avoid the query-string part all together by using something like mod_rewrite (e.g. the front controller for the zend framework makes use of it) or by parsing the contents of $_SERVER["PATH_INFO"] (this requires the webserver to provide that information), e.g. http://localhoast/test.php/foo/bar -> $_SERVER['PATH_INFO']=='/foo/bar'
Also take a look at the link to this thread: How to redirect a Google search result to a dynamic Web page?, it contains the title of the thread, but SO is perfectly happy with How to redirect a Google search result to a dynamic Web page?, too. The title is "only" additional data for search engines and (even more) the user.
You can do the same:
http://www.example.com/products.php/product1/FooEx <-> http://www.example.com/products.php/product2/BarPlus